169k views
4 votes
Iii. Write the pseudocode for a program to take two integer inputs and the operator from user and

display the answers of four basic arithmetic operations ( +- */).

1 Answer

1 vote

Answer:

The pseudocode is as follows:

Input num1, num2

input operator

print num1 + num2

print num1 - num2

print num1 * num2

if num2 != 0

print num1 / num2

else

print "Cannot divide by 0"

Step-by-step explanation:

This gets input for both numbers

Input num1, num2

This gets input for the operator

input operator

This prints the sum

print num1 + num2

This prints the difference

print num1 - num2

This prints the product

print num1 * num2

This prints the division if the divisor is not 0

if num2 != 0

print num1 / num2

else

print "Cannot divide by 0"

User Haagenti
by
4.9k points