Govt. Exams
Entrance Exams
goto transfers program control to a labeled location, though it's discouraged for code readability.
Since 5 > 3 is true, the ternary operator returns 10, so x = 10.
break terminates the loop entirely, while continue jumps to the next iteration without executing remaining statements.
for (int i = 0; i < 3; i++)
printf("%d ", i);
The loop runs from i=0 to i=2 (i < 3), printing '0 1 2 '.
foreach is not a standard C control flow statement. C has if-else, switch, for, while, do-while, and goto.
int x = 5;
if (x > 3)
printf("A");
else
printf("B");
Since x = 5 and 5 > 3 is true, the if block executes and prints 'A'.
The 'const' keyword creates a read-only variable. Once initialized, attempting to modify a const variable results in a compilation error (error: assignment of read-only variable). This is enforced at compile-time, not runtime.
char data type typically occupies 1 byte, which is the minimum. int is 4 bytes, float is 4 bytes, and double is 8 bytes on most systems.
The 'const' keyword declares a constant variable whose value cannot be modified after initialization. Attempting to modify it results in a compile-time error.
A 'long long int' is guaranteed to be at least 64 bits (8 bytes) by the C99 standard on all systems including 64-bit architectures.