C Language - Static and Formal Variables

 



#include <stdio.h>

#include <conio.h>

int b=150;

int func1 (int b1)

{

static int shan = 550;

printf ("the value of shan is %d\n", shan);

shan++;

printf ("\n");

printf ("the address of b is %d\n", &b);

printf ("\n");


printf ("The value of c is %d\n", b);

printf ("\n");


return;


int main()

{

int b=12;

int a = func1(b);

a = func1(b);

a = func1(b);

a = func1(b);

a = func1(b);

a = func1(b);


printf ("The address of b is %d\n", &b);

printf ("\n");


printf ("The value of c is %d\n", b);


return 0;

}

// ScreenShots:




Comments

Popular Posts