Hello, i am fairly new at programming, I wanted to create a program using loops and functions seeing as how i just learned them. I have gotten it to do what i want the program to do, except when the program completes, instead of ending, it repeats the message "That is correct, congrats!" over and over again. Was looking for some help to see what i am doing wrong.
please use [code][/code] tags.
In your function you have an infinite loop for(;;) so you have to call break to stop its execution try adding it in the last else block:
1 2 3 4 5
else
{
cout << "That is correct, congrats!\n";
break;
}