fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int number, num, div, count = 0;
  5. printf("please input integer number > 2\n");
  6. scanf("%d", &num);
  7. printf("prime numbers between 2 and %d are : \n", num);
  8. for(number = 2; number <= num; number++)
  9. {
  10. for(div = 2, number % div != 0; div++);
  11. if(div == number)
  12. {
  13. printf("%5d", number);
  14. if(++count % 10 == 0)
  15. printf("\n");
  16. }
  17. }
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:10:14: warning: right-hand operand of comma expression has no effect [-Wunused-value]
   for(div = 2, number % div != 0; div++);
              ^
prog.c:10:40: error: expected ‘;’ before ‘)’ token
   for(div = 2, number % div != 0; div++);
                                        ^
                                        ;
prog.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &num);
  ^~~~~~~~~~~~~~~~~
stdout
Standard output is empty