Computer Science, asked by moonarmy3186, 1 month ago

write a C++ program to find the smallest of two numbers

Answers

Answered by thilakkumarsivakumar
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