Write a program that computes the average of three input quizzes, then display the result.
Algorithm:
Input Enter three quizzes (q1,q2,q3)
Process Compute the average (ave=(q1+q2+q3/3)
Output Display the average (ave)
Solution:
#include
#include
void main ( )
{
int q1,q2,q3;
flaot ave;
clrscr ( );
printf (“\n Enter three quizzes:”);
scanf (“%d%d%d”,&q1,&q2,&q3);
ave= (q1+q2+q3) /3;
printf (“\n The average:%f”,ave);
getch ( );
}
Comments
Post a Comment