Created
July 24, 2018 13:42
-
-
Save krishnaprajapat/652aeb4da057162c149614c77be78573 to your computer and use it in GitHub Desktop.
Student detail store c++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class student | |
{ | |
int id; | |
char name[20]; | |
public: | |
void getstu(); | |
void putstu(); | |
}; | |
void student::getstu() | |
{ | |
cout<<"enter students details : "; | |
cin>>id>>name; | |
} | |
void student::putstu() | |
{ | |
cout<<"\n"<<id<<"\t"<<name<<endl; | |
} | |
int main() | |
{ | |
int i; | |
student s[5]; | |
for(i=0;i<5;i++) | |
s[i].getstu(); | |
cout<<"\nid"<<"\t"<<"name"; | |
for(i=0;i<5;i++) | |
s[i].putstu(); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment