Sunday, 16 November 2014

Write a program that input 10 numbers from the user in the Array and find out Sum and Average of the Numbers using One Dimensional Array

Leave a Comment
Code:

#include<iostream>
using namespace std;
void main()
{
int number[10],sum=0,average=0;
for(int i=0;i<10;i++)
{
cout<<"Enter Number = ";
cin>>number[i];
sum=sum+number[i];
}
average=sum/10;
cout<<"The Sum of total 10 values = "<<sum<<endl;
cout<<"The average of total 10 values = "<<average<<endl;
}

Output:


If You Enjoyed This, Take 5 Seconds To Share It