+ 2
There several confusing questionss which will make you blow in challenges, how many of you had come across these kind of questn?
int a[5]; for (i=0; i<5;i++) { cout<<i[a]; } but the output "01234 " was correct😂😂
6 Réponses
+ 7
In case you don't know,
a[i] = *(a + i) = *(i + a) = i[a]
So, output will be "01234" only.
+ 3
imagine find the bug in thowsands lines of this kind of code...
+ 2
@Setiwan Next actually i too came across that question i had choosen all the options except 100 😂😂 (25, 26,99)
my next try was supposed to be 100😜😋
+ 2
@Anibal Lopes if i had been that much talented then i would been a chief developer in google right now ..lol.😂😂😜
+ 2
in a lot of challenges the code is not usefull to the real world and the objetive is only trick your mind. ok it is a game but I think that situation gives nothing to learning the language.
+ 1
i came across this question in challenge :
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int i=1;
for(;i<100;i++){
if(i>5){
continue;
i*=i;
}
}
cout<<i;
}
// the answer is 100
it blow my mind. need 20 minutes in code playground to understand it.