programme for percentage calculation by if else statement for 10 students with grade in c programe

+1 vote
asked Oct 19, 2019 by mita chakraborty (130 points)

1 Answer

0 votes
answered Oct 26, 2019 by bushra solangi (140 points)
#include <stdio.h>

int main()

{

   int n,sum,i,j,k,l;

   float per;

   printf("Enter RANGE of students:");

   scanf("%d",&n);

   for(i=0;i<n;i++)

   {

   printf("Enter marks of 3 subjects:");

   scanf("%d %d %d",&j,&k,&l);

  sum=j+k+l;

   per=sum/3.0;

   if(per >=90)

   {

printf("A+ GRADE\n");

   }

    else if(per >=80)

   {

printf("A GRADE\n");

   }

   else if(per >=70)

   {

printf("B GRADE\n");

   }

   else if(per >=60)

   {

printf("C GRADE\n");

   }

   else if(per >=50)

   {

printf("D GRADE\n");

   }

   else

   {

printf("FAIL\n");

   }

   }

      return 0;

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...