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;
}
#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:
0 Questions:
Post a Comment