All rights are reserved by Niteesh Kumar.. Theme images by Storman. Powered by Blogger.


Total Pageviews

Blog Archive


Wednesday, 24 September 2014

C++ program to find the average.

By using this programyou can find average of  maximum 50 numbers.

c++ code

#include <iostream.h> void main() { int A[50],n; float sum=0; cout<<"How many numbers do you wish to enter : "; cin>>n; cout<<"\nEnter numbers : "; for(int i=0;i<n;i++) { cin>>A[i]; sum+=A[i]; } cout<<"\nAverage = "<<sum/n; }
OUTPUT- How many numbers do you wish to enter :5 Enter numbers :5 4 8 7 6 Average =6

0 on: "C++ program to find the average."