Advertisement
Guest User

sumon

a guest
Feb 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. class student_info
  4. {
  5. private:
  6.     string name;
  7.     int age;
  8.     float cgpa;
  9.     char dept[30];
  10. public:
  11.     void  user_input();
  12.     void display();
  13. };
  14. void student_info::user_input()
  15. {
  16.     cout<<"Enter the fast student :";
  17.     cin>>name;
  18.     cout<<"Enter age.:";
  19.     cin>>age;
  20.     cout<<"Enter cgpa:";
  21.     cin>>cgpa;
  22.     cout<<"Enter dept:";
  23.     cin>>dept;
  24. }
  25. void student_info::display()
  26. {
  27.     cout<<"\n Name:"<<name;
  28.     cout<<"\n age.:"<<age;
  29.     cout<<"\n cgpa:"<<cgpa;
  30.     cout<<"\n dept:"<<dept;
  31. }
  32. int main()
  33. {
  34.     student_info s;
  35.     s.user_input();
  36.     s.display();
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement