struct data{
int roll;
char name [100];
double marks;
char mob [20];
}std[100];
int main ()
{
int i,n,j;
printf("Number of student: ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter Roll: ");
scanf("%d",&std[i].roll);
getchar();
printf("Enter Student Name: ");
gets(std[i].name);
printf("Enter Total Marks: ");
scanf("%lf",&std[i].marks);
getchar();
printf("Enter Mobile Number: ");
gets(std[i].mob);
printf("\n\n");
}
printf("\nRoll\tName\tTotal Mark\tMobile Number\n");
for(i=0;i<n;i++)
{
printf("%d\t%s\t%.2lf\t\t%s\n",std[i].roll,std[i].name,std[i].marks,std[i].mob);
}
return 0;
}
No comments:
Post a Comment