The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Structure not complited 3
By Guest on 16th January 2023 01:59:04 PM | Syntax: TEXT | Views: 4



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. #include<iostream>
  2. using namespace std;
  3. struct student
  4. {
  5.         string name;
  6.         int age;
  7.         char gender;
  8.         float weight;
  9. };
  10. int main()
  11. {
  12.         student temari[2];
  13.         for(int i=0;i<=1;i++)
  14.         {
  15.                 cout<<"Ente the info about a student "<<endl;
  16.                 cin>>temari[i].name;
  17.                 cin>>temari[i].age;
  18.                 cin>>temari[i].gender;
  19.                 cin>>temari[i].weight;
  20.                 cout<<"the info of the student is "<<endl;
  21.                 cout<<temari[i].name<<endl;
  22.                 cout<<temari[i].age<<endl;
  23.                 cout<<temari[i].gender<<endl;
  24.                 cout<<temari[i].weight<<endl;
  25.                 cout<<endl;
  26.         }
  27.        
  28.  
  29. }



  • Recent Pastes
  • Questions
    12 hours 32 mins 12 secs ago
  • Adrs
    12 hours 37 mins 22 secs ago
  • Docs
    12 hours 38 mins 6 secs ago
  • Servs
    12 hours 38 mins 49 secs ago
  • Srvs
    12 hours 43 mins 38 secs ago