|
C Programming Reference >> C Programming Reference Question Bank >> 19/07/07 - 569 Views - Ratings : Question - Consider the following C source code and guess its output?
Answer - J = 15 Explanation - Easy to answer question if you know what a static local variable is. Static local variables are intialized only once during thier declaration and maintain thier value through out the program like global variables. Notice that j value thoguh get changes in each loop and will be equal value return by counter ie. final value of count during last iteration of for loop. Value of count keep changing with each loop iteration - 0,1,3,6,10,15. Reader Comments -
|
|||