Friday, August 29, 2014

If the marks obtained by a student in five different subjects are input through the keyboard, find out the aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that can be obtained by a student in each subject is 100


Code

#include<stdio.h>
int main ()
{
float a,b,c,d,e,f;
float g;

printf ("Enter marks of 1st subject: ");
scanf ("%f",&a);

printf ("Enter marks of 2nd subject: ");
scanf ("%f",&b);

printf ("Enter marks of 3rd subject: ");
scanf ("%f",&c);

printf ("Enter marks of 4th subject: ");
scanf ("%f",&d);

printf ("Enter marks of 5th subject: ");
scanf ("%f",&e);

f = ((a+b+c+d+e)/5);

g = ((a+b+c+d+e)/500)*100;

printf ("\nAggregate marks= %f",f);

printf ("\nPercentage= %f \%",g);

printf ("press any key to close.");

getch ();
return 0;
}

Output

aggregate marks c Language

1 comment :

  1. Sorry to say but you should have given the answer for every age group.

    ReplyDelete

Note: Only a member of this blog may post a comment.

Copyright 2017. All Rights Reserved. Privacy Policy / Terms And Conditions / Sitemap / Contact