fork(1) download
  1. #include <iostream>
  2. void main()
  3. {
  4. START:
  5. cout<<"What Do you want to Do:";
  6. cout<<"1.Encode/n2.Decode";
  7. int ch,n=100,i;
  8. char arr[n], res[n];
  9. cin>>ch;
  10. if(ch==1) {goto EN;}
  11. else if (ch==2) //{ goto DE;}
  12. else cout<<"Wrong Choice"; goto START;
  13. EN:
  14. cout<<"How Many Characters You want to enter :";
  15. cin>>n;
  16. Cout<<"Enter :";
  17. for (i=0,i<=n,i++)
  18. {
  19. cin>>arr[i];
  20. }
  21. for(i=0;i<=n;i++)
  22. {
  23. if (arr[i]=="a") res[i]="l";
  24. if (arr[i]=="b") res[i]="j";
  25. if (arr[i]=="c") res[i]="6";
  26. if (arr[i]=="d") res[i]="h";
  27. if (arr[i]=="e") res[i]="s";
  28. if (arr[i]=="f") res[i]="8";
  29. if (arr[i]=="g") res[i]="k";
  30. if (arr[i]=="h") res[i]="c";
  31. if (arr[i]=="i") res[i]="o";
  32. if (arr[i]=="j") res[i]="2";
  33. if (arr[i]=="k") res[i]="a";
  34. if (arr[i]=="l") res[i]="t";
  35. if (arr[i]=="m") res[i]="7";
  36. if (arr[i]=="n") res[i]="g";
  37. if (arr[i]=="o") res[i]=" ";
  38. if (arr[i]=="p") res[i]="w"
  39. if (arr[i]=="q") res[i]="e";
  40. if (arr[i]=="r") res[i]="m";
  41. if (arr[i]=="s") res[i]="p";
  42. if (arr[i]=="t") res[i]="1";
  43. if (arr[i]=="u") res[i]="u";
  44. if (arr[i]=="v") res[i]="f";
  45. if (arr[i]=="w") res[i]="9";
  46. if (arr[i]=="x") res[i]="y";
  47. if (arr[i]=="y") res[i]="0";
  48. if (arr[i]=="z") res[i]="5";
  49. if (arr[i]=="0") res[i]="q";
  50. if (arr[i]=="1") res[i]="r";
  51. if (arr[i]=="2") res[i]="v";
  52. if (arr[i]=="3") res[i]="d";
  53. if (arr[i]=="4") res[i]="n";
  54. if (arr[i]=="5") res[i]="i";
  55. if (arr[i]=="6") res[i]="z";
  56. if (arr[i]=="7") res[i]="u";
  57. if (arr[i]=="8") res[i]="x";
  58. if (arr[i]=="9") res[i]="b";
  59. if (arr[i]==" ") res[i]="q";
  60. }
  61.  
  62. Cout<<"Encoded Version:";
  63. goto DISPLAY;
  64. DISPLAY:
  65. for(i=0;i<=n;i++)
  66. {
  67. cout<<res[i];
  68. }
  69. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:11: error: '::main' must return 'int'
 void main()
           ^
prog.cpp: In function 'int main()':
prog.cpp:5:1: error: 'cout' was not declared in this scope
 cout<<"What Do you want to Do:";
 ^
prog.cpp:5:1: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.9/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
prog.cpp:9:1: error: 'cin' was not declared in this scope
 cin>>ch;
 ^
prog.cpp:9:1: note: suggested alternative:
In file included from prog.cpp:1:0:
/usr/include/c++/4.9/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
prog.cpp:12:1: error: expected primary-expression before 'else'
 else cout<<"Wrong Choice"; goto START;
 ^
prog.cpp:16:1: error: 'Cout' was not declared in this scope
 Cout<<"Enter :";
 ^
prog.cpp:17:18: error: expected ';' before ')' token
 for (i=0,i<=n,i++)
                  ^
prog.cpp:21:1: error: expected primary-expression before 'for'
 for(i=0;i<=n;i++)
 ^
prog.cpp:21:1: error: expected ';' before 'for'
prog.cpp:21:1: error: expected primary-expression before 'for'
prog.cpp:21:1: error: expected ')' before 'for'
prog.cpp:23:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="a") res[i]="l";
             ^
prog.cpp:23:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="a") res[i]="l";
                        ^
prog.cpp:24:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="b") res[i]="j";
             ^
prog.cpp:24:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="b") res[i]="j";
                        ^
prog.cpp:25:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="c") res[i]="6";
             ^
prog.cpp:25:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="c") res[i]="6";
                        ^
prog.cpp:26:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="d") res[i]="h";
             ^
prog.cpp:26:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="d") res[i]="h";
                        ^
prog.cpp:27:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="e") res[i]="s";
             ^
prog.cpp:27:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="e") res[i]="s";
                        ^
prog.cpp:28:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="f") res[i]="8";
             ^
prog.cpp:28:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="f") res[i]="8";
                        ^
prog.cpp:29:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="g") res[i]="k";
             ^
prog.cpp:29:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="g") res[i]="k";
                        ^
prog.cpp:30:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="h") res[i]="c";
             ^
prog.cpp:30:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="h") res[i]="c";
                        ^
prog.cpp:31:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="i") res[i]="o";
             ^
prog.cpp:31:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="i") res[i]="o";
                        ^
prog.cpp:32:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="j") res[i]="2";
             ^
prog.cpp:32:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="j") res[i]="2";
                        ^
prog.cpp:33:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="k") res[i]="a";
             ^
prog.cpp:33:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="k") res[i]="a";
                        ^
prog.cpp:34:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="l") res[i]="t";
             ^
prog.cpp:34:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="l") res[i]="t";
                        ^
prog.cpp:35:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="m") res[i]="7";
             ^
prog.cpp:35:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="m") res[i]="7";
                        ^
prog.cpp:36:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="n") res[i]="g";
             ^
prog.cpp:36:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="n") res[i]="g";
                        ^
prog.cpp:37:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="o") res[i]=" ";
             ^
prog.cpp:37:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="o") res[i]=" ";
                        ^
prog.cpp:38:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="p") res[i]="w"
             ^
prog.cpp:38:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="p") res[i]="w"
                        ^
prog.cpp:39:1: error: expected ';' before 'if'
 if (arr[i]=="q") res[i]="e";
 ^
prog.cpp:40:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="r") res[i]="m";
             ^
prog.cpp:40:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="r") res[i]="m";
                        ^
prog.cpp:41:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="s") res[i]="p";
             ^
prog.cpp:41:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="s") res[i]="p";
                        ^
prog.cpp:42:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="t") res[i]="1";
             ^
prog.cpp:42:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="t") res[i]="1";
                        ^
prog.cpp:43:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="u") res[i]="u";
             ^
prog.cpp:43:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="u") res[i]="u";
                        ^
prog.cpp:44:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="v") res[i]="f";
             ^
prog.cpp:44:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="v") res[i]="f";
                        ^
prog.cpp:45:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="w") res[i]="9";
             ^
prog.cpp:45:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="w") res[i]="9";
                        ^
prog.cpp:46:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="x") res[i]="y";
             ^
prog.cpp:46:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="x") res[i]="y";
                        ^
prog.cpp:47:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="y") res[i]="0";
             ^
prog.cpp:47:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="y") res[i]="0";
                        ^
prog.cpp:48:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="z") res[i]="5";
             ^
prog.cpp:48:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="z") res[i]="5";
                        ^
prog.cpp:49:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="0") res[i]="q";
             ^
prog.cpp:49:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="0") res[i]="q";
                        ^
prog.cpp:50:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="1") res[i]="r";
             ^
prog.cpp:50:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="1") res[i]="r";
                        ^
prog.cpp:51:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="2") res[i]="v";
             ^
prog.cpp:51:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="2") res[i]="v";
                        ^
prog.cpp:52:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="3") res[i]="d";
             ^
prog.cpp:52:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="3") res[i]="d";
                        ^
prog.cpp:53:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="4") res[i]="n";
             ^
prog.cpp:53:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="4") res[i]="n";
                        ^
prog.cpp:54:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="5") res[i]="i";
             ^
prog.cpp:54:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="5") res[i]="i";
                        ^
prog.cpp:55:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="6") res[i]="z";
             ^
prog.cpp:55:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="6") res[i]="z";
                        ^
prog.cpp:56:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="7") res[i]="u";
             ^
prog.cpp:56:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="7") res[i]="u";
                        ^
prog.cpp:57:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="8") res[i]="x";
             ^
prog.cpp:57:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="8") res[i]="x";
                        ^
prog.cpp:58:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]=="9") res[i]="b";
             ^
prog.cpp:58:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]=="9") res[i]="b";
                        ^
prog.cpp:59:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
 if (arr[i]==" ") res[i]="q";
             ^
prog.cpp:59:24: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
 if (arr[i]==" ") res[i]="q";
                        ^
stdout
Standard output is empty