thanks everyone. it is solved finally. i did something different than both of you mentioned but it is working.
#include <iostream>
using namespace std;
int main()
{
// Identifying Variables
int sum=0;
int count=0;
int average=0;
int smallestnumber=0;
int largestnumber=0;
int x=0;
while(x!=-999)
{
cout <<" Enter a number (-999 to quit)";
cin >> x;
if (x==-999){
break;
}
sum=sum + x;
if (count==0){
largestnumber = x;
smallestnumber = x;
}
if (x > largestnumber){
largestnumber = x;
}
if (x < smallestnumber){
smallestnumber = x;
}
count++;
}
cout << "The sum of the values entereed is" << sum << endl;
cout << "The number of values entered is" << count << endl;
average = sum/count;
cout << "The average of values entered is" << average << endl;
cout << "The maximum value entered is" << largestnumber << endl;
cout << "The minimum value entered is" << smallestnumber << endl;
return 0;
}