Q. What will be output if you execute the following c code? void main (){ int i=10; static int value=i; if (value==i) printf( "Both are Equal" ); else if (x>i) printf( "value is Greater than i" ); else printf( "value is Less than i" ); } (a) Both are Equal (b) value is Greater than i (c) value is Less than i (d) Compiler error (e) None of above Ans: (d) Explanation: As we know that static variables are load time entity while auto variables are run time entity. Son it is not possible to initialize any load time variable by the run time variable. In the above example i is a run time variable while x is load time variable.
This site offers a solution for difficult programming problems. The solution covers several programming languages like C, WordPress, WooCommerce, JS etc.