fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3.  
  4. void main(char) {
  5. char a[20],b[20],c[20],d[20];
  6. printf("enter a word");
  7. scanf("%c %c %c %c",&a,&b,&c,&d);
  8. printf("% %c %c %c",a,b,c,d);
  9. if (a==#)
  10. {
  11. printf("%c %c %c",b,c,d);
  12. }
  13. else if (b==#)
  14. {
  15. printf("%c %c %c",a,c,d);
  16. }
  17. else if (c==#)
  18. {
  19. printf("%c %c %c",a,b,d);
  20. }
  21. else if (d==#)
  22. {
  23. printf("%c %c %c",a,b,c);
  24. }
  25.  
  26. // your code goes here
  27.  
  28. }
  29. return(0);
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
hi
hello 
shit
hey
#shit
compilation info
prog.c:4:7: warning: return type of 'main' is not 'int' [-Wmain]
  void main(char) { 
       ^
prog.c:4:7: warning: first argument of 'main' should be 'int' [-Wmain]
prog.c:4:7: warning: 'main' takes only zero or two arguments [-Wmain]
prog.c: In function 'main':
prog.c:4:2: error: parameter name omitted
  void main(char) { 
  ^
prog.c:7:10: warning: format '%c' expects argument of type 'char *', but argument 2 has type 'char (*)[20]' [-Wformat=]
    scanf("%c %c %c %c",&a,&b,&c,&d);
          ^
prog.c:7:10: warning: format '%c' expects argument of type 'char *', but argument 3 has type 'char (*)[20]' [-Wformat=]
prog.c:7:10: warning: format '%c' expects argument of type 'char *', but argument 4 has type 'char (*)[20]' [-Wformat=]
prog.c:7:10: warning: format '%c' expects argument of type 'char *', but argument 5 has type 'char (*)[20]' [-Wformat=]
prog.c:8:11: warning: conversion lacks type at end of format [-Wformat=]
    printf("% %c %c %c",a,b,c,d);
           ^
prog.c:8:11: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
prog.c:8:11: warning: format '%c' expects argument of type 'int', but argument 3 has type 'char *' [-Wformat=]
prog.c:8:11: warning: format '%c' expects argument of type 'int', but argument 4 has type 'char *' [-Wformat=]
prog.c:8:11: warning: too many arguments for format [-Wformat-extra-args]
prog.c:9:11: error: stray '#' in program
    if (a==#)
           ^
prog.c:9:12: error: expected expression before ')' token
    if (a==#)
            ^
prog.c:11:13: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
      printf("%c %c %c",b,c,d);
             ^
prog.c:11:13: warning: format '%c' expects argument of type 'int', but argument 3 has type 'char *' [-Wformat=]
prog.c:11:13: warning: format '%c' expects argument of type 'int', but argument 4 has type 'char *' [-Wformat=]
prog.c:13:16: error: stray '#' in program
    else if (b==#)
                ^
prog.c:13:17: error: expected expression before ')' token
    else if (b==#)
                 ^
prog.c:15:13: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
      printf("%c %c %c",a,c,d);
             ^
prog.c:15:13: warning: format '%c' expects argument of type 'int', but argument 3 has type 'char *' [-Wformat=]
prog.c:15:13: warning: format '%c' expects argument of type 'int', but argument 4 has type 'char *' [-Wformat=]
prog.c:17:16: error: stray '#' in program
    else if (c==#)
                ^
prog.c:17:17: error: expected expression before ')' token
    else if (c==#)
                 ^
prog.c:19:13: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
      printf("%c %c %c",a,b,d);
             ^
prog.c:19:13: warning: format '%c' expects argument of type 'int', but argument 3 has type 'char *' [-Wformat=]
prog.c:19:13: warning: format '%c' expects argument of type 'int', but argument 4 has type 'char *' [-Wformat=]
prog.c:21:16: error: stray '#' in program
    else if (d==#)
                ^
prog.c:21:17: error: expected expression before ')' token
    else if (d==#)
                 ^
prog.c:23:13: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
      printf("%c %c %c",a,b,c);
             ^
prog.c:23:13: warning: format '%c' expects argument of type 'int', but argument 3 has type 'char *' [-Wformat=]
prog.c:23:13: warning: format '%c' expects argument of type 'int', but argument 4 has type 'char *' [-Wformat=]
prog.c: At top level:
prog.c:29:1: error: expected identifier or '(' before 'return'
 return(0);
 ^
stdout
Standard output is empty