#include<iostream.h>
#include<conio.h>
class extra
{
int n;
public:
extra()
{
n=0;
}
extra(int a)
{
n=a;
}
void assgn(int a);
void display();
};
inline void extra::assgn(int a)
{
n=a;
}
inline void extra:: display()
{
int i;
for(i=0;i<=n;i++)
{
cout<<"\n"<<i;
}
}
void main()
{
extra e;
int a;
clrscr();
cout<<"Enter value";
cin>>a;
e.assgn(a);
e.display();
getch();
}
No comments:
Post a Comment