Calculating Total and Percent By Using C

#include<stdio.h>
#include<conio.h>
void main ()
{
float total,math,bio,phy,eng,comp,avg;
clrscr();
printf(“Enter the value of your subject,math,bio,phy,eng,comp\n”);
scanf(“%f%f%f%f%f”,&math,&bio,&phy,&eng,&comp);
total=math+bio+phy+eng+comp;
printf(“Your total number=%0.2f\n”,total);
avg=total/5;
printf(“Your percent=%0.2f %”,avg);
getch();
}

After Running Program 🙂

 

Leave a Reply