Yes, it is working without any error. Some programmers like to use this to organize the code. But the main purpose of curly brackets is to group several lines of codes.
-
-
Incorrect operator is ‘<>’.This is the format correct when writing conditional statements, but it is not a correct operation to indicate not equal in C programming and it gives compilation error as follows. Code Error
-
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); } }