fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main (){
  5. int j=2, i, m, N, flag = 1;
  6. printf("Enter N: ");
  7. scanf_s(" %d", &N);
  8. for (i=0; i <= N; i++){
  9. m= sqrt(i)
  10. for (j; j<=N; j++){
  11. if ((i/i ==0) &&(i%m==0)){
  12. printf ("%2d", i);
  13. }
  14. else {
  15. flag = 0;
  16. }
  17. }
  18. return 0;
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:18: error: ‘scanf_s’ was not declared in this scope
 scanf_s(" %d", &N);
                  ^
prog.cpp:9:11: error: ‘sqrt’ was not declared in this scope
  m= sqrt(i)
           ^
prog.cpp:10:20: error: expected ‘;’ before ‘)’ token
   for (j; j<=N; j++){
                    ^
prog.cpp:19:1: error: expected ‘}’ at end of input
 }
 ^
prog.cpp:19:1: error: expected ‘}’ at end of input
stdout
Standard output is empty