#Why does this loop twice?

3 messages · Page 1 of 1 (latest)

stuck bay
#

I put a space before %c just so I can avoid this but still outputs this if I enter A

You entered A
Error
Enter A or B:

vale hornet
#

You need to add else before the second if. That'll make it one big if/else if/else block with 3 conditions: if A, if B, and everything else.

Since you don't have that "else if" your code is doing
If A print A
If B print B
Else Error

You want
If A print A
Else If B print B
Else Error