Write a C language program which create a Variables marks of data int variable percentage of data type floot and variable grade of data type and show result...!
Answers
Answered by
0
Answer:
If percentage >= 90% : Grade A
If percentage >= 80% : Grade B
If percentage >= 70% : Grade C
If percentage >= 60% : Grade D
If percentage >= 40% : Grade E
If percentage < 40% : Grade F
Example
Input
Input marks of five subjects: 95
95
97
98
90
Output
Percentage = 95.00
Grade A
Answered by
1
Answer:
#include <stdio.h>
int main()
{
int marks;
int total=100;
scanf("%d",&marks);
float percentage;
percentage=(marks*100)/total;
printf("Percentage is %f \n",percentage);
printf("Grade is");
if(percentage>=70)
printf("A");
else if(percentage>=35)
printf("B");
else
printf("F");
return 0;
}
input:34
output:
Percentage is 34.000
Grade is F
Note : Change total marks depending on your requirement.
Similar questions
India Languages,
4 months ago
Math,
4 months ago
Math,
9 months ago
English,
9 months ago
Hindi,
1 year ago