Thursday, July 4, 2019

global variables in c language



#include <stdio.h>
#include <stdlib.h>


void funcl(void) ;
void func2(void) ;
int a,b=6;

void main()
{
    printf("Inside main()a=%d b=%d\n",a,b);
funcl();
func2();
}

void funcl(void)
{
   printf("\nInside funcl() a=%d,b=%d\n",a,b);
}

void func2 (void)
{
    int a=8;
    printf("\nInside func2() a=%d, b=%d\n",a,b);

}


output::
Inside main()a=0 b=6

Inside funcl() a=0,b=6

Inside func2() a=8, b=6

No comments:

Post a Comment

python class topic video