i want to ask help from u guyz...
please check the code below is correct or no to fine smallest no.
this was me and my friend's first program after learn c++ in our class...
Quote
int x, y, z;
{
cout << "enter no 1: " << endl;
cin >> x;
cout << "enter no 2: " << endl;
cin >> y;
cout << "enter no 3: " << endl;
cin >> z;
}
if (x >= y )
{
cout << "The smallest value is: " << y << endl;
}
else if ( x <= z)
{
cout << "The smallest value is: " << x << endl;
}
else
{
cout << "The smallest value is: " << z << endl;
}
{
cout << "enter no 1: " << endl;
cin >> x;
cout << "enter no 2: " << endl;
cin >> y;
cout << "enter no 3: " << endl;
cin >> z;
}
if (x >= y )
{
cout << "The smallest value is: " << y << endl;
}
else if ( x <= z)
{
cout << "The smallest value is: " << x << endl;
}
else
{
cout << "The smallest value is: " << z << endl;
}


Sign In
Create Account

Back to top









