#include<stdio.h>
int i = 0;
void val();
int main()
{
printf("\nmain's i = %d", i);
i++;
val();
printf("\nmain's i = %d", i);
val();
return 0;
}
void val()
{
i = 100;
printf("\nval's i = %d", i);
i++;
}
Output:
main's i = 0
val's i = 100
main's i = 101
val's i = 100