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


Please Help Members By Posting Answers For Below Questions

What are the advantages of prototyping?

565


Does c++ cost money?

582


What is a constant reference?

622


What is encapsulation in C++? Give an example.

588


What is an adjust field format flag?

644






How is c++ different from java?

561


What is binary object model?

600


Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?

630


Write a program to concatenate two strings.

582


Are vectors faster than arrays?

569


Where is atoi defined?

581


what are the decision making statements in C++? Explain if statement with an example?

654


Differentiate between an array and a list?

705


Which software is best for coding?

572


When does a 'this' pointer get created?

618