Hi I was wandering if youd be able to help me with Introduct
Solution
Please follow the data and description :
1)
int i = -4, total = 2;
do {
total *= i;
i++;
} while(i < 0);
System.out.println(total);
The Output is 48.
So the answer is OPTION C (48).
2)
Block: within any class or method, the code between a pair of curly brackets is called a block.
So the answer is OPTION E (Block).
3)
Based on the order of operations for a variables execution the given options c < 4 || d > 16 && c < 7 and the c < 0 || d > 14 && d < 20 are true. So the answer is OPTION E (both c and d).
4)
int e = 3;
while(e <= 5){
cout << ++e << \" \" << endl;
}
So the result is 4 5 6. It is OPTION D (4 5 6).
5)
After a value is returned from a called function the program control reverts to the calling function.
SO the answer is OPTION B (Calling Function).
6)
The value that is to be returned needs to be typecasted or even converted to the defined datatype to run the code. So this is always done.
So the answer is OPTION C (Always).
7)
An external variable is a variable defined outside any function block. On the other hand, a local (automatic) variable is a variable defined inside a function block.
So teh answer is OPTION B (extern);
8)
for(int i = 1; i <= 3; i++) {
for(int j = 5; j > 2; j = j - 2){
cout << \"Hello\" << endl;
}
}
OUTPUT :
Hello
Hello
Hello
Hello
Hello
Hello
So the count is 6.
So the answer is OPTION C (6).
9)
If a break statement is omitted in the switch case statement then all the cases will be executed successfully.
So the answer is OPTION B (all).
10)
Given,
x = 2 + y-- = 3
So the value of y needs to be 2 as y-- = 1 and the x = 2 + y-- = 2 + 1 = 3
So teh answer is 2,1 and the OPTION C (2,1).
Hope this is helpful.

