Write a program that will compute the average of a set of decimal numbers provided by the user. The program will ask the user to enter numbers one at a time. The user will enter numbers and the program will keep a count of the numbers entered. At the end, the program will display the sum, the count and the average of the numbers. See Test section below for test data.
This is what i have but it is not functioning properly. after the second time i am asked a number the program gets an error and asks to quit. Help please i have no idea how to fix this.
#include <iostream>
using namespace std;
int main()
{
int sum,count,average;
double num=0;
cout<<"Enter a number"<<endl;
cin>>num;
count=0;
while(cin!=NULL)
{
cout<<"Enter a number"<<endl;
cin>>num;
average=sum/count;
sum=sum+num;
count++;