TCS Company Programming Variables

Comment on the below while statement=while (0 == 0) { }
A) It has syntax error as there are no statements within braces {}
B) It will run forever
C) It compares 0 with 0 and since they are equal it will exit the loop immediately
D) It has syntax error as the same number is being compared with itself

Read Solution (Total 3)

TCS Other Question

If a function is defined as static, it means
1. The value returned by the function does not change
2. all the variable declared inside the function automatically will be assigned
initial value of zero
3. It should be called only within the same source code / program file.
4. None of the other choices as it is wrong to add static prefix to a function
What will happen if in a C program you assign a value to an array element
whose subscript exceeds the size of array?
1. The element will be set to 0.
2. The compiler would report an error.
3. The program may crash if some important data gets overwritten.
4. The array size would appropriately grow.