Tuesday 22 January 2013

constructer


#include<iostream.h>
#include<conio.h>
class student
{
private:
int marks;
char grade;
public:
student () //constructer
{
marks=80;
grade='A';
}
void show()
{
cout<<"\n marks is :"<<marks<<endl;
cout<<"\n the grade is :"<<grade<<endl;
}
};
void main()
{
student s1;
cout<<"record of s1";
s1.show();
getch();
}

0 comments:

Post a Comment