Professor Student data base system project
#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;
}
Comments
Leave a comment