Advertisement
salmancreation

Avarage Number Of Test Exam

Jun 17th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2.     int main()
  3.     {
  4.         float test = 0;
  5.         float number = 0;
  6.         float gpa = 0;
  7.         float avarage = 0;
  8.  
  9.         do
  10.         {
  11.             printf("Number of Test:%.0f    Avarage : %.2f \n",test,avarage);
  12.             scanf("%f",&number);
  13.             gpa+=number;
  14.             test++;
  15.             avarage = gpa/test;
  16.  
  17.         }while(number !=0);
  18.  
  19.  
  20.         return 0;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement