write a C++ program to find the smallest of two numbers
Answers
Answered by
3
Answers:
int main()
{
int number1, number2, smallest ;
cout<<"Enter first number: ";
cin>>number1;
cout<<"Enter second number: ";
cin>>number2;
if(number1<number2)
{
smallest=number1;
}
else
{
smallest=number2;
}
cout<<"Smallest of the two number is: "<<smallest;
return 0;
}
Output:
Enter first number: 5
Enter second number: 9
Smallest of the two number is: 5
Similar questions
Math,
28 days ago
Social Sciences,
28 days ago
History,
28 days ago
Social Sciences,
1 month ago
Computer Science,
9 months ago