This program is supposed to find the sum, min, max and if its odd or even. Must ask the user to input 10 numbers. I keep getting zero for min. Can someone help me fix this code.
#include <iostream>
using namespace std;
int main()
{
int number, max, min;
int sum=0;
int x=1;
min=number;
max=number;
while(x<=9){
cout<< "Please enter a number"<<endl;
cin>> number;
{
}if(number%2==0)
cout<< " The number is even" <<endl;
else cout<< "The number is odd"<<endl;
{
sum=sum+number;
}
{
if(number>max)
{
max=number;
}
if(number<min)
{
min=number;
}
}
x=x+1;
}
cout<<"The sum of these numbers is: "<<
sum<<endl;
cout<<"The minimum of these numbers is: "<<
min<<endl;
cout<<"The maximum of these numbers is: "<<
max<<endl;