Skip to main content

Posts

Showing posts with the label 22. Write a C program to input marks of five subjects Physics

ads1

22. Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following:

  22. Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following: Percentage >= 90% : Grade A Percentage >= 80% : Grade B Percentage >= 70% : Grade C Percentage >= 60% : Grade D Percentage >= 40% : Grade E Percentage < 40% : Grade F Solution :-   #include<stdio.h> #include<conio.h> void main() {         clrscr();         float phy,che,bio,maths,comp,total,avg;         printf("Enter the marks of Physics :-");         scanf("%f",&phy);         printf("Enter the marks of Chemistry :-");         scanf("%f",&che);         printf("Enter the marks of Biology:-");         scanf("%f",&bio);         printf("Enter the marks of Mathematics:-");         scanf("%f",&maths);         printf("Enter the marks of Comuter:-");         scanf("%f",&comp);   

ads2