program in C++ to read 10 numbers from keyboard and find their sum and average


#include <iostream>
using namespace std;
void main()
{
int i,n,sum=0;
float avg;
for (i=1;i<=10;i++)
{
                cout<<"enter number=";
cin>>n;

sum +=n;
}
avg=sum/10.0;
cout<<"The sum of 10 no is :"<<sum<<" The Average is : \n"<< avg;

system("pause");
}

program in C++ to read 10 numbers from keyboard and find their sum and average program in C++ to read 10 numbers from keyboard and find their sum and average Reviewed by Unknown on May 18, 2017 Rating: 5

No comments:

Powered by Blogger.