C support only 2 loops: Entry Control: This loop is categorized in 2 part a. while loop b. for loop Exit control: In this category, there is one type of loop known as a. do while loop.
-
-
main is necessary for executing the code. Code is void main() { }
-
In general programs store data into files and retrieve existing data from files. With the sequential access file such data saved in a sequential pattern. When retrieving data from such files each data needs to read one by one until the required information found.
-
yes, the const means that the variable cannot be assigned a new value. The value can be changed by other code or pointer. For example the following program works fine. int main(void) { const volatile int local = 10; int *ptr = (int*) &local; printf("Initial value of local : %d \n", local); *ptr = 100; printf("Modified value of local: %d \n", local); return 0; }
-
The volatile keyword is intended to prevent the compiler from applying any optimizations on objects that can change in ways that cannot be determined by the compiler. Objects declared as volatile are omitted from optimization because their values can be changed by code outside the scope of current code at any time.
-
When the Header file includes within double quotes (“”), compiler search first in the working directory for the particular header file. If not found then in the built-in the include path. But when the Header file includes within angular braces (<>), the compiler only searches in the working directory for the particular header file.
-
The purpose of the Break keyword is to bring the control out of the code block which is executing. It can appear only in Looping or switch statements.
-
We can use recursion for this purpose. void printNos(unsigned int n) { if(n > 0) { printNos(n-1); printf("%d ", n); } }
-
A loop running within another loop is referred to as a nested loop. The first loop is called the Outer loop and inside the loop is called the Inner loop. The inner loop executes the number of times define an outer loop.
-
This concept called commenting out and is the way to isolate some part of the code which scans possible reason for the error. Also, this concept helps to save time because if the code is not the reason for the issue it can simply uncomment.