Respuesta :
Answer:
The missing code for the above problem is as follows:
Explanation:
Missing code :
cin>>firstNum>>secondNum; // for the first case.
if(firstNum==0||secondNum==0) // for the second case.
cout<<"Both the inputed numbers must be nonzero."; // for the second case.
else if (firstNum>secondNum) // for the third case
cout <<firstNum/secondNum; // for the third case.
else if(secondNum>firstNum) // for the fourth case.
cout <<secondNum/firstNum; // for the fourth case.
else // for the fourth case.
cout<<firstNum*secondNum; // for the forth case.
Output:
- If the user input as 1 and 0, then the output is "Both the inputted numbers must be nonzero.",
- If the user input is 4 and 2 then the output is 2.
- If the user input is 2 and 4 then the output is 2.
Code Explanation:
- The above code has to paste in the place of "Missing code" on the question program code.
- All problem, which is defined in the question can be programmed by the help of the if-else statement.
- The compiler first checks the if condition and then it checks the else-if and then else if the above condition is false.