Sample code for using local variables in a method in C language:
What is the output of below c program?
it prints 10,10,10. since i is a local variable(non-static) of this function, it will be created every time this function is called, and it will be dead on returning from this function. so i is created 3 times with value 10 and it prints 10 all the three times.
Back To Top