Facebook
From Md. Shahadot Hossain Sahed, 6 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 158
  1. #include<iostream>
  2. using namespace std ;
  3. int main (){
  4.     int n,sum;
  5.     int m[100];
  6.     cout<<" Enter number of input :";
  7.     cin>>n;
  8.    
  9.     for( int i=0; i<n; i++){
  10.         cin>> m[i];
  11.         sum = sum + m[i];
  12.  
  13.  
  14.     }
  15.     cout<< " Sum of the integers = " <<sum << endl;
  16.     float avg;
  17.     avg = (float) sum/n;
  18.     cout<< " Average of the integers = " << avg << endl;
  19.    
  20.     return 0;
  21. }