Skip to main content

Posts

Showing posts with the label Mathematics and Computer. Calculate percentage and grade according to following:

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

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

    10. Write a Java 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 Static Solution :-  class result {     public static void main(String args[])     {     int che = 55,phy=70,bio=65,maths=85,comp=80,tot,perc;     tot = che+phy+bio+maths+comp;     perc =tot/5;     System.out.println("The total marks your score is :-"+tot);     System.out.println("The percentage you scored is :- "+perc);        if (perc>=90)     {         System.out.println("Your grade is A :- "+perc);     }     else if (perc>=80)     {         System.out.println("Your grade is B :- "+perc);     }     else if (perc>=70)     {         System.out.println("Your grade

ads2