In: Computer Science
write a program that takes two input values from the user and calculate the division if the first number is greater than the second one otherwise calculate the multiplication.
#include <iostream>
using namespace std;
int main()
{
int num1,num2; // Variable declaration and initialization
cout << "Enter First Number: ";
cin>>num1; //get first number
cout << "Enter Second Number: ";
cin>>num2; //get second number
//check first number is greater than second number
if(num1>num2)
{
//Division operation is perform
cout<<"Division is: "<<(num1/num2)<<endl;
}
else
{
//Multiplication operation is perform
cout<<"Multiplication is:
"<<(num1*num2)<<endl;
}
return 0;
}
===============================OUTPUT====================================
==Please Upvote==