Write a pseudocode algorithm which inputs numeric scores and outputs the average score. The end of the data is signalled by a user input of -1.
Answers
tex
<\bf
~src~
Multiplies the existing cell value by 100 and displays the result with a percent symbol. If you format the cell first and then type the number, only numbers between 0 and 1 are multiplied by 100. The only option is the number of decimal places.
Pseudocode algorithm
Explanation:
do{
input=take input
}
While(input not equal to -1)
{
Store in an array for every input
Like append the new input to an array
}
After loop terminates
Take average of the array
By traversing through all elements of array and store in a variable
The sum divided by length of array gives the average
IN C language:
#include<stdio.h>
Int main(){
Int input,i=0,sum,avg,are[1000];
Do{
Scanf(“%d”,&input);
}
While(input !=0)
{
arre[i]=input;
i=i+1;
}
Sum=sum(arre[]);
Avg=sum/len(arre);
Printf(“%d”,Avg);
Return 0;
}