0% found this document useful (0 votes)
4 views1 page

C++ Student Class Program Example

The document contains a C++ program that defines a class 'STUDENT' with methods to enter and view student details. It includes attributes for roll number, name, and marks. The main function creates an instance of the class, calls the methods to input data, and displays the output.

Uploaded by

Harry Potter
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

C++ Student Class Program Example

The document contains a C++ program that defines a class 'STUDENT' with methods to enter and view student details. It includes attributes for roll number, name, and marks. The main function creates an instance of the class, calls the methods to input data, and displays the output.

Uploaded by

Harry Potter
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

/* PROGRAM OF A CLASS */

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class STUDENT
{ int RN;
char NAME[20];
float MARKS;
public:
void ENTER();
void VIEWALL();
};
void STUDENT::ENTER()
{
cout<<" ENTER VALUES : "<<endl;
cout<<" ENTER ROLL NO. : ";
cin>>RN;
cout<<" ENTER NAME : ";
gets(NAME);
cout<<" ENTER MARKS: ";
cin>>MARKS;
}
void STUDENT::VIEWALL()
{ cout<<"\n OUTPUT : "<<endl;
cout<<" ROLL NO. : " <<RN<<endl;
cout<<" NAME : " <<NAME<<endl;
cout<<" MARKS : " <<MARKS<<endl;
}
void main()
{clrscr();
STUDENT S;
[Link]();
[Link]();
getch();
}
OUTPUT :-

You might also like