Skip to content
Related Articles

Related Articles

Improve Article

Algorithms Quiz | SP2 Contest 1 | Question 11

  • Difficulty Level : Basic
  • Last Updated : 03 Nov, 2020




#include <iostream>
using namespace std;
  
int main() {
      
    int i = 256;
      
    for(;;)
       {
           cout<<"Hello World\n";
             
           i = i<<1;
             
           if(i<0)
                break;
       }
          
    return 0;
}

How many times will “Hello World” be printed by the above program?
(A) 23
(B) 32
(C) 11
(D) Infinite Loop


Answer: (A)

Explanation:

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :