Tuesday 13 April 2021

Storage classes in C and C++ - 3

 #include<stdio.h>

#include<conio.h>

#include<iostream.h>

int a=5;

void show();

int main()

{

clrscr();

a=10;

extern int a;      //variable already declare in global scope.

cout<<a;

show();

a=20;

cout<<endl<<a;

show();

cout<<endl<<a;

getch();

return 0;

}


int a;

void show()

{

cout<<endl<<a;

a=50;

}

No comments:

Post a Comment