Create a C++ program that reads N integers and prints their average. Your program should ask first for a value N. Using a while loop, get the N integers and compute their average. At the end, print the average. Your program should print an appropriate message if the user enters 0 as the value for N.
#include <iostream>
using namespace std;
int main(){
cout<<"Enter N\n";
int N;
cin>>N;
if (N==0) cout<<"You entered the wrong number N=0\n";
else {
double av = 0;
int NN = N;
while (NN >0)
{
NN--;
double temp;
cin>>temp;
av+=temp;
}
cout<< "Average: "<<av/N<<endl;
}
system("pause");
return 0;
}