Q. What is the output of this code?

Code:
int main() {
    int a = 5, b = 10;
    while (a < b) {
        printf("%d ", a);
        a++;
    }
    return 0;
}
  • (A) 5 6 7 8 9
  • (B) 6 7 8 9 10
  • (C) 5 6 7 8 9 10
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5 6 7 8 9
Explanation: The loop prints numbers from 5 to 9; when a becomes 10, the loop exits.
Explanation by: Mr. Dubey
The loop prints numbers from 5 to 9; when a becomes 10, the loop exits.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
82
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
96%
Success Rate