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
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 value is placed in choice. int a=5,b=10,c=15 choice=a>b && a>c? a:(b>c? b:c);
5
15
10
0
What Value is placed in awk?
int x=5,y=19; awk=y-x>x-y?Y-x:X-Y;
19
14
-14
What is a Java program?
Set of commands
Set of statements
Set of system calls
Set of operators
Consider the following code Char c='a'; switch(c) { case 'a': System out println("A"); case 'b': System out println("B"); default: System .out.println("c"));
which of the following statement is true for he above code?
Output will be A
Output will be A followed by B
Output will be A,followed by B,and then following C
Will not compile
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 var? var=12>9?0:1;
1
9
12
What is the sequence of statement contained in a pair of braces called as?
block
function
branch
Class
Which of the following statement can make decisions based on single integer value?
if
else if
cause
switch