Answer:
Here is the Python program. If you want the program in some other programming language let me know.
x = int(input("Enter the value of x: "))
y = int(input("Enter the value of y: "))
op = input("Enter an arithmetic operator : ")
operation = 0
if op == '+':
operation = x + y
elif op == '-':
operation = x - y
elif op == '*':
operation = x * y
elif op == '/':
operation = x / y
elif op == '%':
operation = x % y
else:
print("Invalid Character!")
print(x, op , y, "=", operation)
Explanation:
The program prompts the user to enter the value of x and y. These values are stored in variables x and y
Then the program prompts the user to enter an arithmetic operator. op variable stores the value of operator entered by the user.
If else statement is used which checks the the character of operator ( +, - , /, * or %) that the user inputs and performs the arithmetic operation according to the input operator. The if else part that will be executed to perform the arithmetic operation is based on the operator that the user enters. For example if the user enters / then the third elif part is executed and the value of x and y are divided.
The screen shot of output of the program is attached.