Answer:
sum = 0 must be before for loop. If inside for loop, it will keep resetting sum to 0 each iteration.
Explanation:
hope this helps
Answer:
HELP ... I WILL GIVE ALL THE POINTS IT CAN.
THE QUESTIONS ARE:
1. ACCORDING TO THE SUBCLASSIFICATION OF EACH WEB SITE AS YOU WOULD DEFINE THE TYPES OF THE WEBSITE.
2. WHAT IS THE DIFFERENCE BETWEEN EACH SUBCLASSIFICATION OF THE WEBSITES
3. LIST EXAMPLES OF EACH SUBDIVISION
THE SUBCLASSIFICATIONS IN QUESTION ARE: SITE BY HEARING, BY DYNAMISM BY OPENING, BY DEPTH AND BY OBJECTIVE
Explanation:
What is the question needed to be answered?
Answer:
Following are the code in c language
#include <stdio.h> // header file
int main() // main function
{
int n1,i;
float avg,x,s=0; // variable declaration
printf("\nEnter How many Number terms you want:");
scanf("%d",&n1); // input terms by user
for(i=0;i<n1;++i)
{
scanf("%f",&x); // user input
s= s +x; //calculate sum
}
avg = s/n1;// calculate average of n number
printf("\nThe average of n number is:");
printf("%f",avg); // display average
return 0;
}
Output
Enter How many Number terms you want:3
3
4
3
The average of n number is:3.333333