-
Notifications
You must be signed in to change notification settings - Fork 0
/
2ndxzc.c
42 lines (38 loc) · 882 Bytes
/
2ndxzc.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
#include <stdio.h>
typedef struct student
{
char name[100];
int age;
float cgpa;
char fname[50];
} STU;
int main()
{
int n;
scanf("%d", &n);
getchar();
STU s[n];
for (int i = 0; i < n; i++)
{
printf("Enter the value of person %d: \n", i + 1);
printf("Name: ");
gets(s[i].name);
printf("Age: ");
scanf("%d", &s[i].age);
printf("CGPA: ");
scanf("%f", &s[i].cgpa);
getchar();
printf("Father name: ");
gets(s[i].fname);
}
for (int i = 0; i < n; i++)
{
printf("\nPerson %d: ", i + 1);
printf("\nName: %s", s[i].name);
printf("\nAge: %d", s[i].age);
printf("\nCGPA: %.2f", s[i].cgpa);
printf("\nFather name: %s", s[i].fname);
printf("\n\n");
}
return 0;
}