Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class student_info
- {
- private:
- string name;
- int age;
- float cgpa;
- char dept[30];
- public:
- void user_input();
- void display();
- };
- void student_info::user_input()
- {
- cout<<"Enter the fast student :";
- cin>>name;
- cout<<"Enter age.:";
- cin>>age;
- cout<<"Enter cgpa:";
- cin>>cgpa;
- cout<<"Enter dept:";
- cin>>dept;
- }
- void student_info::display()
- {
- cout<<"\n Name:"<<name;
- cout<<"\n age.:"<<age;
- cout<<"\n cgpa:"<<cgpa;
- cout<<"\n dept:"<<dept;
- }
- int main()
- {
- student_info s;
- s.user_input();
- s.display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement