Easy Tutorial
For Competitive Exams

What will be the output of the program?

for(int i = 0; i < 3; i++) {

switch(i) {

case 0: break;

case 1: System.out.print("one ");

case 2: System.out.print("two ");

case 3: System.out.print("three ");

}

}

System.out.println("done");

one two three two three done
one two done
done
one two three two three
Explanation:

The variable i will have the values 0, 1 and 2.

When i is 0, nothing will be printed because of the break in case 0.

When i is 1, "one two three" will be output because case 1, case 2 and case 3 will be executed (they don`t have break statements).

When i is 2, "two three" will be output because case 2 and case 3 will be executed (again no break statements).

Finally, when the for loop finishes "done" will be output.

Additional Questions

What will be the output of the following program on GCC?

int main(){

static int c=5;

printf("c=%d",c--);

if(c)

main();

return 0;

}

Answer

What is the base class for all Exception ?

Answer

In SQL, which command is used to remove a stored function from the database?

Answer

bus is a / an

Answer

Form of code that uses more than one process and processor, possibly of different type, and that may on occasions have more than one process or processor active at the same time, is known as

Answer

Which of the following system program forgoes the production of object code to generate absolute machine code and load it into the physical main storage location from which it will be executed immediately upon completion of the assembly?

Answer

an instruction in a programming language that is replaced by a sequence of instructions prior to assembly or compiling is known as

Answer

Which policy replace a page if it is not in the favoured subset of a process,s pages?

Answer

There are certain packages that allow people to define data items, place these items in particular records, combine the records into designated files and then manipulate and retrieve the stored datWhat are they called?

Answer

Subschema can be used to

Answer
Share with Friends
Privacy Copyright Contact Us