-
Notifications
You must be signed in to change notification settings - Fork 0
/
EX_1.cpp
44 lines (44 loc) · 942 Bytes
/
EX_1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<iostream>
#include<string>
using namespace std;
struct student
{
char name[12];
int DOB;
int rollno;
char branch[12];
float marks;
};
int main()
{
int n;
cout<<"Enter the number of the students:";
cin>> n;
student students[n];
for(int i=0;i<n;i++)
{
cout<<"Enter the details of the student: "<<i+1<< ":"<<endl;
cout<<"Name:"<<endl;
cin>>students[i].name;
cout<<"DOB"<<endl;
cin>>students[i].DOB;
cout<<"roll no."<<endl;
cin>>students[i].rollno;
cout<<"branch"<<endl;
cin>>students[i].branch;
cout<<"marks"<<endl;
cin>>students[i].marks;
cout<<endl;
}
for(int i=0;i<n;i++)
{
cout<<"student"<<i+1<< ":"<<endl;
cout<<"Name"<<students[i].name<<endl;
cout<<"DOB"<<students[i].DOB<<endl;
cout<<"rollno"<<students[i].rollno<<endl;
cout<<"branch"<<students[i].branch<<endl;
cout<<"marks"<<students[i].marks<<endl;
cout<<endl;
return 0;
}
}