Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to print sum and average of inputted numbers

Posted By: Theoden Thompson     Category: C Programming     Views: 11152

Program to print sum and average of inputted numbers

Code for Program to print sum and average of inputted numbers in C Programming

#define N 10

void main()
{
    int count;
    float sum,average,number;
    clrscr();

    sum=0;
    count=0;

    while(count < N)
    {
        scanf("%f", &number);
        sum=sum+number;
        count=count+1;
    }

    average = sum / N;
    printf("N = %d Sum = %f",N,sum);
    printf("Average = %f",average);
    getch();
}
  
Share: 


Didn't find what you were looking for? Find more on Program to print sum and average of inputted numbers Or get search suggestion and latest updates.

Theoden Thompson
Theoden Thompson author of Program to print sum and average of inputted numbers is from Perth, Australia.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!