-
Notifications
You must be signed in to change notification settings - Fork 0
/
student_details.c
78 lines (73 loc) · 1.63 KB
/
student_details.c
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include<stdio.h>
int main(){
struct student {
int rollnum;
char name[50];
char branch[20];
int marks;
}s[5];
int i;
printf("Enter the information of students:");
for(i=0;i<5;i++)
{
printf("\nEnter the information of roll number %d\n",i+1);
s[i].rollnum=i+1;
printf("Enter name of the student:");
scanf("%s",s[i].name);
printf("Enter Branch:");
scanf("%s",s[i].branch);
printf("Enter PPS marks:");
scanf("%d",&s[i].marks);
}
printf("Displaying Student Details:\n");
for(i=0;i<5;i++)
{
printf("Roll Number:%d\nStudent Name: %s\nBranch:%s\nMarks:%d\n",s[i].rollnum,s[i].name,s[i].branch,s[i].marks);
}
return 0;
}
------------------------------------------------------------------------
output:
Enter the information of students:
Enter the information of roll number 1
Enter name of the student:Monika
Enter Branch:IT
Enter PPS marks:70
Enter the information of roll number 2
Enter name of the student:Anamitra
Enter Branch:CSE
Enter PPS marks:84
Enter the information of roll number 3
Enter name of the student:Chakrika
Enter Branch:EEE
Enter PPS marks:69
Enter the information of roll number 4
Enter name of the student:Vishruthi
Enter Branch:AIML
Enter PPS marks:73
Enter the information of roll number 5
Enter name of the student:Keerthana
Enter Branch:IT
Enter PPS marks:76
Displaying Student Details:
Roll Number:1
Student Name: Monika
Branch:IT
Marks:70
Roll Number:2
Student Name: Anamitra
Branch:CSE
Marks:84
Roll Number:3
Student Name: Chakrika
Branch:EEE
Marks:69
Roll Number:4
Student Name: Vishruthi
Branch:AIML
Marks:73
Roll Number:5
Student Name: Keerthana
Branch:IT
Marks:76
--------------------------------