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
English,
1 month ago
Science,
1 month ago
Geography,
1 month ago
Social Sciences,
2 months ago
Computer Science,
10 months ago