Answer:
import random
num1 = random.randint(0, 1000)
num2 = random.randint(0, 1000)
print(str(num1) + " + " + str(num2) + " = ?")
result = int(input("Enter the answer: "))
if result == (num1 + num2):
print("Congratulations!")
else:
print("The correct answer is: " + str(num1 + num2))
Explanation:
*The code is in Python.
Import the random to be able to generate random numbers
Generate two numbers, num1 and num2, between 0 and 1000
Ask the sum of the num1 and num2
Get the input from the user
If the answer is correct, display a message of congratulations. Otherwise, display the correct answer