is there any way possible that we can declare variables in C or C++ without using a semi-colon.
ps: #define x 0 - is a constant and not a variable!
Here's a solution to TEST in C++ without semicolons:
#include <cstdio> int main() { if (bool b=true) { while (b) { if (int x=1) if (scanf("%d",&x)) if (x!=42) if (printf("%d\n",x)) {} else {} else if (b=false) {} } } }
thanks man.
i forgot the scope thing, i was doing the same thing.this is something like what i was doing, which obviously gave 'undeclared 'x''.
if(int x=1){} if(getchar()){if(x=2){}}
thanks for the help man.
chyba lepiej while(cin>>a)jak w teście na końcu wystąpią dodatkowe entery (czasem sie zdarza):
in:
1 4 1 1 1 1 4 5 4 4 5 1 -1
mój out:
4 2
twój out:
4 2 0