Q. What will be the output of the following C code?

Code:
#include <stdio.h>

int main(){
    int i, j;

    for (i = 2; i < 10; i++) {
        for (j = 2; j <= (i / j); j++)
            if (!(i % j))
                break;
        if (j > (i / j))
            printf("%d ", i);
    }

    return 0;
}
  • (A) 2 3 4 5 6 7 8 9
  • (B) 3 5 7 9
  • (C) 2 3 5 7
  • (D) 2 3 5 7 11
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2 3 5 7

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
339
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
82%
Success Rate