Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How long does this loop run:

for(int x=0; x=3; x++)
a) Never
b) Three times
c) Forever

Answers were Sorted based on User's Feedback



How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / 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

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / guest

Forever

Is This Answer Correct ?    55 Yes 9 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / manju

The correct and verified answer is the loop runs forever

the answer is c. it is so becoz in condition part we are
giving i=3 and not i==3.


so it executes infinite times.

Is This Answer Correct ?    32 Yes 3 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / eric

The loop will run forever.
K.premalatha is the foolest lady I have ever met.

Is This Answer Correct ?    17 Yes 3 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / sentrix

Forever.

Is This Answer Correct ?    17 Yes 4 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / john

the loop runs forever guys....
have you tried this? without trying u r giving the random answers?
Sentrix, Eric, Manju,Pracheer Gupta are right...
other guys please try it....

Is This Answer Correct ?    17 Yes 4 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer /

#include<stdio.h>
main()
{
for(int x=0; x=3; x++)
printf("Forever.....");
}

Is This Answer Correct ?    14 Yes 2 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / divya

hai john I tried this in online compiler but it shows some errors....didnt give exact ans...Is there any other ways to conform this answer.

Is This Answer Correct ?    2 Yes 0 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / madhupathania

forever

Is This Answer Correct ?    1 Yes 0 No

How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever ..

Answer / 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

More C++ General Interview Questions

Why do we use the using declaration?

0 Answers  


What does #define mean in c++?

0 Answers  


Why do we need c++?

0 Answers  


What is c++ 11 and c++ 14?

0 Answers  


Is c the same as c++?

0 Answers  


Write about c++ storage classes?

0 Answers  


What is tellg () in c++?

0 Answers  


the first character in the variable name must be an a) special symbol b) number c) alphabet

0 Answers  


char *ch = "abcde"; char c[4]; how to copy 'ch' to 'c'?

4 Answers   Thomson Reuters,


Declare a class vehicle and make it an abstract data type.

0 Answers  


How many storage classes are available in C++?

1 Answers  


what is difference between internet and Internet?

12 Answers   College School Exams Tests, Microsoft, MIT, TCS,


Categories