forked from swaaz/basicprograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.c
More file actions
29 lines (29 loc) · 679 Bytes
/
Copy pathprogram.c
File metadata and controls
29 lines (29 loc) · 679 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
#include <stdio.h>
struct student
{
char n[100];
char u[100];
int m;
}stud[10],stud2;
int main()
{
int n,i=0;
printf("Enter the number of student\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("Enter the details of student - %d\n",i);
printf("Enter the name of the student\n");
scanf("%s",stud[i].n);
printf("Enter USN\n");
scanf("%s",stud[i].u);
printf("Enter total marks\n");
scanf("%d",&stud[i].m);
}
printf("|\tSl.no\t|\tName\t\t|\tUSN\t\t|\tMark\t|\n");
for(i=1;i<=n;i++)
{
printf("|\t%d\t|\t%-10s\t|\t%s\t|\t%d\t|\n",i,stud[i].n,stud[i].u,stud[i].m);
}
return 0;
}