Computer Science, asked by phenomayush, 1 year ago

WRITE C program for student grade system

Answers

Answered by mangharam
1
We can enter mark to our c program and the script will try to find out the grade by using series of if elsecondition checking. Each if else condition check for mark for a particular grade and if it is TRUE then all other checking ( if else ) are omitted. Here is the sample code.
Answered by samarthkrv
1

Answer:

#include<conio.h>

#include <stdio.h>

int main() {

   double esm , total , average , percentage ,esm1;

   int subjects;

   printf("Enter the number of subjects:");

   scanf("%i" , &subjects);

   printf("Enter total marks for each subject:");

   scanf("%lf" , &esm1);

   double grades[subjects];

       for(int i = 0; i < subjects; i++)

           {

               printf("Enter marks of subject %i:" , (i+1));

               scanf("%lf" , &esm);

               grades[i] = esm;

               total = total + grades[i];

           }

           percentage = (total / (esm1*subjects)) * 100;

           average = total / subjects;

           printf("Your total is : %lf \n" , total);

           printf("Your average is :%lf \n" , average);

           printf("Your percentage is :%lf\n" , percentage);

 getch();

   return 0;

}

Explanation:

Similar questions