Its a simple math sum quiz that is asking the user for sum of same numbers from 1 to 10
The expected output is :
What is 1 + 1?
In every single iteration of the outer loop , after questioning like this , the program waits for the user input. When the user inputs a number, it checks the sum with the input value . If the sum is right, the user is informed that the answer is right. And then then same is repeated for 2. i.e.
What is 2 + 2?
If the user input is not right, the user is given three chances to input the right answer. After 3 consecutive wrong answers by the user , the real answer is displayed to the user and then the outer loops moves towards the next number.
The right variable is used for a boolean value here
I.e. 1 = true , 0 = false.
When the user answers wrong , the right variable is set to false.
4
solved What is nested loop in c? [closed]