Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

PROGRAM 1

PROGRAM TO CREATE A CLASS FOR ENTERING AND DISPLAYING STUDENT DETAILS


#include<iostream.h>
#include <conio.h>
#include <stdio.h>
class ADMISSION
{
int AD_NO;
char NAME[20];
int CLASS;
float FEES;
public:
void Read_Data()
{
do
{
cout << "Enter admission no.(11-1999) : ";
cin >> AD_NO;
}while (AD_NO<10 || AD_NO>2000);
cout << "Enter name : ";
gets(NAME);
cout << "Enter class : ";
cin >> CLASS;
cout << "Enter fees : ";
cin >> FEES;
}
void Display()
{
cout<<"\n\nDetails of student are ::\n ";
cout << "Admission no. : " << AD_NO << endl;
cout << "Name : " << NAME << endl;
cout << "Class : " << CLASS << endl;
cout << "Fees : " << FEES << endl;
}
};
void main()
{ clrscr();
ADMISSION adm;
adm.Read_Data();
getch();
adm.Display();
getch();

}
OUTPUT

You might also like