How long does this loop run:
for(int x=0; x=3; x++)
a) Never
b) Three times
c) Forever
Answer Posted / pracheer gupta
what r u saying guys..
the loop will run c) forever
this is bcoz in the termination part it is actually x=3 and
not x==3.
x=3 will always evaluate to true and hence the loop is
executed infinite times.
| Is This Answer Correct ? | 94 Yes | 11 No |
Post New Answer View All Answers
What are the extraction and insertion operators in c++?
How can I improve my c++ skills?
What is pointer to array in c++?
Can we sort map in c++?
Are c and c++ different?
How to tokenize a string in c++?
explain the reference variable in c++?
What is difference between c++ and c ++ 14?
What are signs of manipulation?
What c++ is used for?
What are pointer-to-members? Explain.
Explain dangling pointer.
Can static member variables be private?
If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3
Write about the scope resolution operator?