dck
Junior Member level 1
//Write a full program that reads user input of 10 scores and store them in an array.
//Next, calculate and display the total number of scores that are above the average score.
#include<stdio.h>
main()
{
int i, num=0,j;
double input[10], total=0, average;
for(i=0;i<10;i++)
{
printf("Plz enter input\n");
scanf("%lf", &input);
}
for(i=0;i<10;i++)
{
total=total+input;
}
printf("Total is %.2f\n", total);
average=total/10;
printf("\nAverage is %.2f\n", average);
for(j=0;j<10;j++)
{
if(input > average)
num++;
}
printf("Number of scores that above average is %d\n", num);
}
why isnt my program working??
i had spent hours over it...
//Next, calculate and display the total number of scores that are above the average score.
#include<stdio.h>
main()
{
int i, num=0,j;
double input[10], total=0, average;
for(i=0;i<10;i++)
{
printf("Plz enter input\n");
scanf("%lf", &input);
}
for(i=0;i<10;i++)
{
total=total+input;
}
printf("Total is %.2f\n", total);
average=total/10;
printf("\nAverage is %.2f\n", average);
for(j=0;j<10;j++)
{
if(input > average)
num++;
}
printf("Number of scores that above average is %d\n", num);
}
why isnt my program working??
i had spent hours over it...