New course! Every coder should learn Generative AI!
Try a free lesson+ 7
Pranav pratap Singh
Compiling on cxxdroid gives this.
<stdin>:3:1: error: C++ requires a type specifier for all declarations
main()
^
//Use return type ! It works in C but still the valid return type is int only
<stdin>:25:19: warning: if statement has empty body [-Wempty-body]
if(a%2==0);
//hmm semicolon after if?
<stdin>:25:19: note: put the semicolon on a separate line to silence this warning
<stdin>:27:13: error: expected expression
else
^
<stdin>:50:26: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
printf("\n%d"b);
^
//seperate by specifier and variable by comma.
<stdin>:50:26: error: expected ')'
<stdin>:50:19: note: to match this '('
printf("\n%d"b);
^
<stdin>:51:13: error: expected expression
else
^
//can't use 'else' without if !
edit: that downvote is not mine 😅🍵