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 c++ manipulators?
If there are two catch statements, one for base and one for derived, which should come first?
What is pointer to member?
Explain selection sorting. Also write an example.
What c++ is used for?
When should overload new operator on a global basis or a class basis?
Is c++ harder than java?
What is size_type?
Explain the concept of memory leak?
Which format specifier is used for printing a pointer value?
How many standards of c++ are there?
What is stoi in c++?
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
Will this c++ program execute or not?
What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack