C examples for Language Basics:Variable
For example, the following program prints the number 10 ten times:
#include <stdio.h> void f(void); int main(void) { int i;// w w w. j a v a 2 s . c o m for (i = 0; i<10; i++) f(); return 0; } void f(void) { int j = 10; printf("%d ", j); j++; /* this line has no lasting effect */ }