#include<stdio.h> #include<conio.h> #define sz 20 struct std { int r_no; char name[40]; char add[40]; int m1,m2,m3; }; void main() { struct std s[sz]; int i; clrscr(); for(i=0;i<sz;i++) { printf("\nRoll no: "); scanf("%d",&s[i].r_no); flushall(); printf("Name: "); gets(s[i].name); printf("Address: "); gets(s[i].add); printf("Mark1: "); scanf("%d",&s[i].m1); printf("Mark2: "); scanf("%d",&s[i].m2); printf("Mark3: "); scanf("%d",&s[i].m3); } printf("\nFailed students' info:\n"); printf("\nRollno Name\t\t\tAddress\t\t\tMark1 Mark2 Mark3"); printf("\n------ ----\t\t\t-------\t\t\t----- ----- -----"); for(i=0;i<sz;i++) if(s[i].m1<40||s[i].m2<40||s[i].m3<40) printf("\n%-5d %-25s%-25s%-7d%-7d%-7d",s[i].r_no,s[i].name,s[i].add,s[i].m1,s[i].m2,s[i].m3); getch(); }
WHAT'S NEW?
Loading...
0 comments:
Post a Comment