C++ program to find average of list of numbers entered through keyboard
#include<iostream.h> #include<conio.h> void main() { clrscr(); //to clear the screen int i,n,x,sum=0; cout<<“How many numbers?”; cin>>n; for(i=1;i<=n;++i) { cout<<“nEnter number “<<i<<“: “; cin>>x; sum+=x; } x=sum/n; cout<<“nnAverage=”<<x; getch(); //to stop the screen }