Computer Science, asked by irshadahmad4373, 7 months ago

Write a program that ask for the name, rollnumber, class, section and marks in different subjects of a student of class 10th .The program should calculate and display total marks and % of the student .(Hint: use INPUT statment to get data from the user suppose total marks are 850)

Answers

Answered by GamerAzim
0

#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;

}

Similar questions