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

the output is undefined
because c++ do not implicitly initialised the varible. it
gives garbage value for uninitialized variables

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are polymorphisms mutations?

677


when to use 'mutable' keyword and when to use 'const cast' in c++

1623


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2069


c++ program to swap the objects of two different classes

1711


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1754






What are the 3 principles of oop?

586


Can we have inheritance without polymorphism?

594


What are the benefits of oop?

583


What are the 4 main oop principles?

647


How Do you Code Composition and Aggregation in C++ ?

24144


What is for loop and its syntax?

571


What is polymorphism and why is it important?

540


write a program that takes input in digits and display the result in words from 1 to 1000

1964


What do you mean by variable?

545


Is react oop?

587