#include
#include
main()
{
ind r[5],m1[5],m2[5],m3[5],i;
float p[5];
clrscr();
for(i=0;i<5;i++)
{
printf("\nInput roll number and marks in 3 subject for student %d \n",i+1);
scanf("%d%d%d%d",&r[i],&m1[i],&m2[i],&m3[i]);
}
clrscr();
for(i=0;i<75;printf("-"),i++);
printf("\nRoll no\t Marks obtained in \t Percentage\t Result");
printf("\n\t sub1 sub2 sub3\n");
for(i=0;i<75;printf("-"),i++);
for(i=0;i<5;i++)
{
p[i]=(m1[i]+m2[i]+m3[i])/3.0;
printf("\n%d\t%d\t%d\t%d\t%5.2f\t",r[i],m1[i],m2[i],m3[i],p[i]);
if(p[i]<40.0)
printf("\tfail");
else
printf("\tpass");
}
printf("\n");
for(i=0;i<75;printf("-"),i++);
}
pls upload a c program for the following:
ReplyDeleteDesign a structure student_record to contain name, date of
birth and total marks obtained.
Define a structure data type date containing three integer
members namely day, month and year to represent the date of birth.
Develop a program to read data for 10 students in a class and list
them rank-wise.