How long does this loop run:

for(int x=0; x=3; x++)
a) Never
b) Three times
c) Forever

Answer Posted / manju

The correct and verified answer is the loop runs forever

the answer is c. it is so becoz in condition part we are
giving i=3 and not i==3.


so it executes infinite times.

Is This Answer Correct ?    32 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are mutator methods in c++?

645


What is the full form of dos?

566


. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?

2755


What is Destructor in C++?

638


Is main a class in c++?

560






What is the benefit of c++?

601


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1459


How a macro differs from a template?

637


What are the classes in c++?

636


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

551


Mention the storage classes in c++.

647


Explain polymorphism?

586


When can I use a forward declaration?

624


Define a conversion constructor?

614


What are static and dynamic type checking?

612