calling variables ...
#include<iostream.h>
#include<conio.h>
int a=2; // global variable
void main()
{
int a=5; // local variable
cout<<"value is:"<<a<<endl;
cout<<"value of global variable is:"<<::a;
getch();
}
Output
value is:5
value of global variable is:2
#include<iostream.h>
#include<conio.h>
int a=2; // global variable
void main()
{
int a=5; // local variable
cout<<"value is:"<<a<<endl;
cout<<"value of global variable is:"<<::a;
getch();
}
Output
value is:5
value of global variable is:2
No comments:
Post a Comment