-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10p3.c
More file actions
38 lines (30 loc) · 842 Bytes
/
10p3.c
File metadata and controls
38 lines (30 loc) · 842 Bytes
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
#include <stdio.h>
struct student {
char firstName[100],address;
int roll;
float marks;
} s[50];
int main() {
int i;
printf("Enter information of students:\n");
for (i = 0; i < 15; ++i) {
s[i].roll = i + 1;
printf("\nFor roll number%d,\n", s[i].roll);
printf("Enter first name: ");
scanf("%s", s[i].firstName);
printf("Enter marks: ");
scanf("%f", &s[i].marks);
printf("Enter address: ");
scanf("%s", &s[i].address);
}
for (i = 0; i < 15; ++i) {
printf("\nRoll number: %d\n", i + 1);
printf("First name: ");
puts(s[i].firstName);
printf("Marks: %.1f", s[i].marks);
printf("\n");
printf("Address ");
puts(s[i].address);
}
return 0;
}