0
How many times "Hello, world" be printed in the below program?
#include<stdio.h> Int main() { int i=1024; for( ;i;i>>=1) printf ("Hello, world\n"); return 0; }
12 Answers
+ 1
Int main() - bug;āŗ
After bitwise operation:
1. 1024/2=512;
2. 512/2=256;
3. 256/2=128;
4. 128/2=64;
5. 64/2=32;
6. 32/2=16;
7. 16/2=8;
8. 8/2=4;
9. 4/2=2;
10. 2/2=1;
11. 0b1>>1=0;
+ 7
The Q&A isn't for creating quizzes, maybe you should check out the quiz factory š
+ 6
I don't k know c or c++, but you could copy & paste the text in a code, and test it. š
+ 4
i don't think this is a problem that need to be solve by the community for you, as said by š Alex Tusinean š run the code and you get your answer
+ 1
I am discussing my question with you guys not an error... If you can't solve,then simply say I don't know.. or just don't answer my question.. that's it.. what makes you to think that much about this I don't know.. if you can than do it...
+ 1
Not once, since you have a mistake in the code.āŗ
+ 1
Akash Khanpara
Right, right š
C++ is case sensitive!
+ 1
Yup.. perfect.. Thanks..Vasiliy
0
Nope.. wrong.. Vasiliy
0
But it's c programming question.. Vasiliy
0
Akash Khanpara
Thank! Now I will remember for a long time that 1024 in binary notation is a unit with ten zeros!āŗ
0
Right.. Vasiliy š¤