write a c program to take input of name roll no. and marks obtained by a student in 5 subjects each have its 100 full marks and display the name roll no. with percentage score secured ?
Answers
The C program for taking a student's name, roll number, and marks from five subjects (each with 100 full marks), and displays the information along with the student's percentage score as follows:
#include <stdio.h>
struct student {
char name[50];
int roll;
float marks;
float percentage;
} 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("Enter Percentage:");
scanf("%f", &s.percentage);
printf("Displaying Information:\n");
printf("Name: ");
printf("%s", s.name);
printf("Roll number: %d\n", s.roll);
printf("Marks: %.1f\n", s.marks);
printf("Percentage: %f\n", s.percentage);
return 0;
}
For more such questions on C programming: https://brainly.in/question/49917585
#SPJ3