Write a program in c to maintain student record with fields name,roll no, marks of three subjects.And calculate total marks and percentage of the student using structure
Answers
Answered by
0
INPUT:
#include <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("Displaying Information:\n");
printf("Name: ");
printf("%s", s.name);
printf("Roll number: %d\n", s.roll);
printf("Marks: %.1f\n", s.marks);
return 0;
}
OUTPUT:
Enter information:
Enter name: Jack
Enter roll number: 23
Enter marks: 34.5
Displaying Information:
Name: Jack
Roll number: 23
Marks: 34.5
HOPE THIS HELPS YOU AND PLZ FOLLOW ME FOR MORE ANSWERS AND MARK ME AS BRAINLIEST
Similar questions
Science,
5 months ago
English,
5 months ago
English,
10 months ago
Accountancy,
10 months ago
English,
1 year ago
Environmental Sciences,
1 year ago