.
Home About-us Privacy Policy Contact-us Services

Thursday, October 8, 2015

c++ program to declare the global object

ad+1


Program -
 
#include<iostream.h>
#include<conio.h>
Class abc
{
public:
int a;
int b;
void read()
{
cin>>a>>b;
}
void display()
{
cout<<a<<b;
}
};
class abc m1;
void main()
{
void fun();
m1.a=20;
m1.read();
m1.display();
fun();
{
m1.b=30;
m1.read();
m1.display();
}
}

Output

20 40 77 20 30



0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates