A

Admin • 802.91K Points
Coach

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
  • Correct Answer - Option(C)
  • Views: 3
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.