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