#include<iostream>
using namespace std;
int main()
{
int count_numbers=0;
cout<<"How many numbers you want to enter:";
cin>>count_numbers;
int number=0;
int sum=0;
for(int i=0;i<count_numbers;++i){
cout<<"Enter number "<<i+1<<"::";
cin>>number;
sum+=number;
}
cout<<"Sum of numbers::"<<sum<<endl;
cout<<"Average of "<<count_numbers<<" Numbers"<<"::"<<double(sum)/count_numbers;
return 0;
}
Comments
Leave a comment