Answer:
Step-by-step explanation:
#!/bin/bash
# Generate two random numbers between 1 and 100
num1=$((1 + RANDOM % 100))
num2=$((1 + RANDOM % 100))
# Print the math problem
echo "$num1"
echo "+ $num2"
echo ""
# Read the user's answer
read -p "Enter your answer: " answer
# Calculate the correct answer
correct=$((num1 + num2))
# Check if the answer is correct
if [ "$answer" -eq "$correct" ]; then
echo "Congratulations, your answer is correct!"
else
echo "Sorry, the correct answer is $correct."
fi