What value is placed in var? var=12>9?0:1;
0
1
9
12
What Value is placed in awk?
int x=5,y=19; awk=y-x>x-y?Y-x:X-Y;
5
19
14
-14
Which of the following is the general form of a simple 'if ' condition?
if(intialization;test condition;incremented) { statement-block; }
if (test expression) { Statement -block }
if (expression) { Statement -block; }
All of the above
What is a chain of if in which the statement associated with each 'else' is an 'if'?
else if ladder
nested if...else
Switch case statement
Both a and b
Which of the following control expressions are valid for an if statement?
An integer expression
A boolean expression
either 1 or 2
neither 1 or 2
What will the comparison operators in Java returns?
Boolean value
An integer
depends upon data type
both a and b
What is meant by conditional branching?
Branching based on particular condition.
Branching done if condition is true
Branching is done if condition is false
Branching takes place without any decision.
What value is placed in choice. int a=5,b=10,c=15 choice=a>b && a>c? a:(b>c? b:c);
15
10
Consider the following code
if (number > 0)
System.out.println("Number of positive");
else
System .out.println("Number is Negative");
What will be the output if number is equal to 0?
Number is negative
Number is positive
Both 1 and 2
Number is zero
Which of the following is the general form of the conditional operator?
expression 1:expression 2?conditional expression;
conditional expression? expression 1 : expression 2;
Conditional expression:expressions?expression2;
All of them