global and local variables

This commit is contained in:
Mert Gör
2024-11-01 08:03:36 +03:00
parent 293bc9b7ec
commit 9716cce895
2 changed files with 23 additions and 0 deletions

21
c-basic/global_local.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdio.h>
int a;
void foo()
{
int a;
a = 10;
}
int main()
{
a = 20;
printf("%d\n", a);
foo();
printf("%d\n", a);
return 0;
}