How long does this loop run:
for(int x=0; x=3; x++)
a) Never
b) Three times
c) Forever
Answer Posted / awaneesh dubey
Never . It will show compile time error . boolean required
at the terminationa condition not int . i.e. it should be
for(int x=0; x==3; x++) not for(int x=0; x=3; x++) .
x=3 will cause compilation error. So answer is never .
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Are there any special rules about inlining?
What is the use of endl in c++ give an example?
Write about a nested class and mention its use?
Where must the declaration of a friend function appear?
What is the benefit of encapsulation?
What is scope resolution operator in c++ with example?
What does catch(…) mean?
If a header file is included twice by mistake in the program, will it give any error?
How new/delete differs from malloc()/free?
What is a .h file c++?
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
What is std :: endl?
Differentiate between realloc() and free().
Which function should be used to free the memory allocated by calloc()?
Explain how overloading takes place in c++?