Class and Objective With Array [ Programming in C++ ]

Class and Objective With Array [ Programming in Cpp ]

#include <iostream>
#include <conio.h>
Class student
{
Int roll;
Char name [30];
Public:
Void input()
{
Cout<<”Enter roll No & name”; Cin>>roll>>name;
}
Void show()
{
Cout<<”your roll No=”<<roll<<endl;
Cout<<”your name= “<<name<<endl;
};
Void main()
{
Clrscr();
Student st[4];
For(i=0;i<4;i++)
{
St[i] input();
}
Cout<<”Student Detail”;
For(i=0;i<4;i++)
St[i] show();
}
Getch();
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.