fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int num;
  5. printf("Pls enter any integer\n");
  6. scanf(&num);
  7. printf("you have entered" &num);
  8. return 0;
  9. }
  10.  
Compilation error #stdin compilation error #stdout 0s 2168KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:6:8: warning: passing argument 1 of 'scanf' from incompatible pointer type [-Wincompatible-pointer-types]
  scanf(&num);
        ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from prog.c:1:
/usr/include/stdio.h:446:12: note: expected 'const char * restrict' but argument is of type 'int *'
 extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
            ^
prog.c:7:28: error: invalid operands to binary & (have 'char *' and 'int')
  printf("you have entered" &num);
                            ^
stdout
Standard output is empty