Chapter 05: General Programming and Decision Making

1.	A compound statement is enclosed in.
a)	Parenthesis
b)	Square brackets
c)	Brackets
d)	All of them

2.	Select the selective statement among the following?
a)	goto 
b)	if
c)	for
d)	None of these

3.	In run time error the program executes but doesn’t give the desired output.
a)	True
b)	False

4.	If ((a! =b) && (a==c)), means:
a)	‘b’ is the greatest number
b)	‘b’ is the smallest number
c)	‘a’ is the smallest number
d)	Both (a) and (b)

5.	A break statement:
a)	Can be used in a switch statement
b)	Cannot be used in a switch statement
c)	Is compulsory to be used in a switch statement
d)	None

6.	Determine the value of a:
double b = -15.6
double a = Math.rint(Math.abs(b));
a)	15
b)	-15
c)	-16
d)	16

7.	In a switch case, what happens when the value of the switch is not satisfied?
a)	The execution transfers to a loop
b)	The execution transfers to a default statement
c)	The execution transfers to a break statement
d)	None

8.	If ((a>b) && (b>c) && (c>d)), then choose the correct statement: 
a)	‘d’ is the smallest number
b)	‘d’ is the greatest number
c)	‘a’ is the smallest number
d)	None of these

9.	Two arithmetic expressions can be compared with if statement using?
a)	Logical operator
b)	Null operator
c)	Ternary operators
d)	Arithmetic operator

10.	Name the type of error
Math.sqrt(36-45)
a)	Syntax
b)	Logical
c)	Run Time
d)	None of these

11.	If condition is formed by using?
a)	Ternary operator
b)	Logical operator
c)	Arithmetic operators
d)	Relational operators

12.	if(a!=b)
   c=a;
else
   c=b;
Can be written as:
a)	c= (a! =b)? b : a;
b)	c= (b! =a)? a : b;
c)	c= (a! =b)? a : b;
d)	Both (b) and (c)