Answer to Question #209647 in C++ for Ali

Question #209647

Professor Student data base system project


1
Expert's answer
2021-06-22T17:20:17-0400
#include <iostream>


using namespace std;
struct Student{
    string name;
    string regNo;
    int phoneNo;
    string email;
};
int main()
{
    int n;
    cout<<"\nEnter the number of students: ";
    cin>>n;
    struct Student e[n];
    for(int i=0;i<n;i++){
        cout<<"\nEnter details of student "<<i+1<<endl;
        cout<<"\nEnter name: ";
        cin>>e[i].name;
        cout<<"\nEnter regNo: ";
        cin>>e[i].regNo;
        cout<<"\nEnter phoneNo: ";
        cin>>e[i].phoneNo;
        cout<<"\nEnter email: ";
        cin>>e[i].email;
    }
    cout<<"\nThe details all students include:\n";
    for(int i=0;i<n;i++){
        cout<<"Student "<<i+1<<" details\n";
        cout<<"Name:"<<e[i].name;
        cout<<"RegNo:"<<e[i].regNo;
        cout<<"Phone No:"<<e[i].phoneNo;
        cout<<"Email:"<<e[i].email;
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS