Skip to content

Instantly share code, notes, and snippets.

@krishnaprajapat
Created July 24, 2018 13:42
Show Gist options
  • Save krishnaprajapat/652aeb4da057162c149614c77be78573 to your computer and use it in GitHub Desktop.
Save krishnaprajapat/652aeb4da057162c149614c77be78573 to your computer and use it in GitHub Desktop.
Student detail store c++
#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