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 ? | 91 Yes | 11 No |
Post New Answer View All Answers
How can I disable the "echo" feature?
How do pointers work?
Can class objects be passed as function arguments?
What is the use of dot in c++?
Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.
What is time_t c++?
Are c and c++ different?
What is an overflow error?
Array base access faster or pointer base access is faster?
Which software is best for programming?
Define upcasting.
the maximum length of a character constant can be a) 2 b) 1 c) 8
What are the uses of typedef in a program?
What are the advantages of using a pointer? Define the operators that can be used with a pointer.
Who invented turbo c++?