Facebook
From Md.partha, 1 Month ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 98
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int y,sum=0;
  7.     cout<<"Enter the numbers  ";
  8.     cin>>y;
  9.     int number[100];
  10.     for(int i=0; i<y; i++){
  11.     cin>>number[i];
  12.     sum=sum+number[i];
  13.  
  14.     }
  15.     cout<<" sum of the numbers is "<<sum<<endl;
  16.  
  17.     float ave=(float)sum/y;
  18.     cout<<" The average of these number is  "<<ave;
  19.     return 0;
  20. }