Recent

Comments

Follow us on Facebook

Monday 27 November 2017

find sum and avg of number using array in c+= for loop


find sum and avg of number using array in c+= for loop


#include <iostream>
using namespace std;
main ()
{
int n[10],sum,avg;
for(int i=0;i<10;i++)
{
cout<<"enter the number"<<i+1<<"   =  ";
cin>>n[i];
}
for (int i=0;i<10;i++)
{
sum+=n[i];
avg=sum/5;
}
cout<<"sum  of the number is   =  "<<sum<<endl;
cout<<"avg of the number is    = "<<avg;
}

0 on: "find sum and avg of number using array in c+= for loop"

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix.

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix. ...

propeller ads

PropellerAds