Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- double aver(double num1,double num4){
- return ((num1)/num4);
- }
- double addition(double num1,double num2){return num1+num2;}
- int main(void) {
- double X;
- double average;
- double trials;
- double i=0;
- double sum;
- do{
- printf("\nEnter the test scores: ");
- scanf("%lg",&X);
- sum=addition(X,sum);
- i++;}
- while(X>=0);
- sum-=X;
- average=aver(sum,i-1);
- printf("Average is %lg",average);
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment