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...

What will happen when the following code is run:
int x;
while(x<100)
{
cout<<x;
x++;
}




1) The computer will output "0123...99"


2) The computer will output "0123...100"


3) The output is undefined

Answer Posted / nk

Output is undefined because initially variable 'x' is not
initialized and may contain some garbage value.

However if we initialize 'x' to 0 then choice#1 is correct.

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is encapsulation example?

1124


What are the 5 oop principles?

1167


What is new keyword in oops?

1099


Why is object oriented programming so hard?

1134


What is solid in oops?

1205


Write a program to reverse a string using recursive function?

2411


What is the main feature of oop?

1202


Is this job good for future? can do this job post grduate student?

2220


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4805


Which type does string inherit from?

1160


What is advantage of inheritance?

1226


What is oops and its features?

1151


What is constructor overloading in oop?

1180


Why is encapsulation used?

1054


What is difference between multiple inheritance and multilevel inheritance?

1195