#include <iostream> void main() { START: cout<<"What Do you want to Do:"; cout<<"1.Encode/n2.Decode"; int ch,n=100,i; char arr[n], res[n]; cin>>ch; if(ch==1) {goto EN;} else if (ch==2) //{ goto DE;} else cout<<"Wrong Choice"; goto START; EN: cout<<"How Many Characters You want to enter :"; cin>>n; Cout<<"Enter :"; for (i=0,i<=n,i++) { cin>>arr[i]; } for(i=0;i<=n;i++) { if (arr[i]=="a") res[i]="l"; if (arr[i]=="b") res[i]="j"; if (arr[i]=="c") res[i]="6"; if (arr[i]=="d") res[i]="h"; if (arr[i]=="e") res[i]="s"; if (arr[i]=="f") res[i]="8"; if (arr[i]=="g") res[i]="k"; if (arr[i]=="h") res[i]="c"; if (arr[i]=="i") res[i]="o"; if (arr[i]=="j") res[i]="2"; if (arr[i]=="k") res[i]="a"; if (arr[i]=="l") res[i]="t"; if (arr[i]=="m") res[i]="7"; if (arr[i]=="n") res[i]="g"; if (arr[i]=="o") res[i]=" "; if (arr[i]=="p") res[i]="w" if (arr[i]=="q") res[i]="e"; if (arr[i]=="r") res[i]="m"; if (arr[i]=="s") res[i]="p"; if (arr[i]=="t") res[i]="1"; if (arr[i]=="u") res[i]="u"; if (arr[i]=="v") res[i]="f"; if (arr[i]=="w") res[i]="9"; if (arr[i]=="x") res[i]="y"; if (arr[i]=="y") res[i]="0"; if (arr[i]=="z") res[i]="5"; if (arr[i]=="0") res[i]="q"; if (arr[i]=="1") res[i]="r"; if (arr[i]=="2") res[i]="v"; if (arr[i]=="3") res[i]="d"; if (arr[i]=="4") res[i]="n"; if (arr[i]=="5") res[i]="i"; if (arr[i]=="6") res[i]="z"; if (arr[i]=="7") res[i]="u"; if (arr[i]=="8") res[i]="x"; if (arr[i]=="9") res[i]="b"; if (arr[i]==" ") res[i]="q"; } Cout<<"Encoded Version:"; goto DISPLAY; DISPLAY: for(i=0;i<=n;i++) { cout<<res[i]; } }
Standard input is empty
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";
^
Standard output is empty