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