Write a complete C++ program that reads the attached file (values.txt) to find and print the following:
a. The average value of the numbers in the file.
b. The maximum and minimum value
c. The count of negative and positive values (ignore zero)
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int count=0,sum=0,poscount=0,negcount=0;
double avg,max,min;
cout<<" Enter any integer number: ";
cin>>count;
while (count != 0)
{
{
sum += count;
avg = sum / static_cast <double> (count);
count++;
}
if (count < 0)
{
negcount++;
}
if (count > 0)
{
poscount++;
}
max = count;
if (count > max)
max = count;
min = count;
if (count < min)
min = count;
}
cout<<" The average value of the numbers is: "<<avg<<endl;
cout<<" The maximum number is: "<<max<<endl;
cout<<" The minimum number is: "<<min<<endl;
cout<<" There is "<<poscount<<" positive numbers "<<endl;
cout<<" There is "<<negcount<<" negative numbers "<<endl;
return 0;
}
when I debug it , it just saying " enter any integer number " and I don't know is my code right? or there is something wrong..!