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 / aravind
In most of the compilers now all declared variables are
usually initialised with 0. So in most compilers result
would be #1. But in some cases the garbage values may creep
up.
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the importance of oop?
Why is abstraction used?
What is static modifier?
What is the purpose of polymorphism?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is abstraction in oop with example?
What is meant by multiple inheritance?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< Write a C++ program without using any loop (if, for, while
etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not
use 200 print statements!!!) What is the main feature of oop? What is the main purpose of inheritance law? what type of question are asked in thoughtworks pair programming round ? What is encapsulation selenium? What is difference between oop and pop? What is for loop and its syntax?