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
What is while loops?
Difference between an inspector and a mutator
Can you overload the operator+ for short integers?
What does #define mean in c++?
What are structs in c++?
what is multi-threading in C++?
What are c++ data types?
How are virtual functions implemented in c++?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What is the difference between equal to (==) and assignment operator (=)?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Describe the advantages of operator overloading?
What does new return if there is insufficient memory to make your new object?
What is constant in c++ with example?
What is the full form of stl in c++?