Write a C program to accept details of n students (roll number, name, percentage ) using structure. Display details of the student having maximum percentage.
Answers
Answered by
4
Explanation:
#includes <stdio.h>
struct student {
char name [50];
int roll;
float marks;
} s;
int main () {
printf("Enter information:/n");
printf("Enter name : ");
fgets(s.name , sizeof(s.name), stdin);
printf("Enter roll number : " );
scanf("%d", &s.roll);
printf("Enter marks : ");
scanf("%f" , &s.marks);
printf ("Displacing information : \n");
printf ("Name: ");
printf ("%s", s.name);
printf ("Roll number: %d\n", s.roll);
printf("Marks :%.1f\n", s.marks);
return 0;
Similar questions