#include<stdio.h>
void main()
{ struct{int id;
char name[20];
int math;
int physic;
int english;
int total;
}stu;
printf("Id");
scanf("%d",&stu.id);
printf("Name:");
fflush(stdin);
gets(stu.name);
puts("Math");
scanf("%d",&stu.math);
puts("Physic");
scanf("%d",&stu.physic);
puts("English");
scanf("%d",&stu.english);
stu.total=stu.math+stu.physic+stu.english;
puts("Id\tName\tMath\tPhysic\tEnglish\tTotal");
printf("%d\t",stu.id);
printf("%s\t",stu.name);
printf("%d\t",stu.math);
printf("%d\t",stu.physic);
printf("%d\t",stu.english);
printf("%d",stu.total);
}
Blogger Comment
Facebook Comment