🎴 Flashcard Mode
programming languages Online Quiz - 274
Card1 / 19
Mastered0
Review0
QuestionClick to flip
int i=5; if(i=4) { printf("A"); } else { printf("B"); }
AnswerClick to flip back
A
This code will print A.
💡 Explanation:
In the condition if(i=4), the assignment operator (=) is used instead of the equality operator (==). This assigns the integer 4 to i, and since 4 is non-zero, the condition evaluates to true, causing the code to print A.