Explore topic-wise MCQs in Csharp.

This section includes 27 Mcqs, each offering curated multiple-choice questions to sharpen your Csharp knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the output of the Java program with IF statement?

A. No output
B. ELEPHANT
C. Compiler error
D. None
Answer» D. None
2.

What is the output of the Java program below?

A. 0
B. 4
C. Compiler error
D. None
Answer» D. None
3.

What is the output of Java program below?

A. SUMMER
B. UNKNOWN
C. Compiler error
D. None
Answer» B. UNKNOWN
4.

What is is the output of the Java program?

A. DISTINCTION
B. PASS
C. Compiler error
D. None
Answer» B. PASS
5.

What is the output of the Java program with IF-ELSE-IF statements?

A. DISTINCTION
B. PASS
C. FAIL
D. Compiler error
Answer» C. FAIL
6.

What is the output of the Java program?

A. OK MASTER
B. BYE
C. Compiler error
D. None
Answer» D. None
7.

What is the output of the Java program with IF-ELSE statements?

A. GO
B. STOP
C. Compiler error
D. None
Answer» D. None
8.

What is the output of Java program with IF statement?

A. OK
B. No output
C. Compiler error
D. None
Answer» D. None
9.

Choose a wrong statement on Java IF-ELSE syntax below.

A. if(condition)
B. else
C. if(condition1)
D. if(condition1)
Answer» C. if(condition1)
10.

Choose the correct syntax of Java IF statement below.

A. if(condition)
B. if(condition)
C. if(condition)
D. All
Answer» E.
11.

What is the maximum number of ELSE-IF statements that can present in between starting IF and ending ELSE statements?

A. 32
B. 64
C. 128
D. None
Answer» E.
12.

An IF-ELSE statement is better than a SWITCH statement in which scenario below?

A. Checking for More-than condition
B. Checking for Less-than condition
C. Checking for Ranges
D. All
Answer» E.
13.

What is maximum lines of code that can be written inside a Java style IF, ELSE or IF-ELSE block?

A. 32
B. 64
C. 512
D. None
Answer» E.
14.

If the condition of an IF-statement is false, which is true below.

A. IF block is executed.
B. ELSE block is executed.
C. Both IF and ELSE blocks are skipped.
D. Both IF and ELSE blocks are executed.
Answer» C. Both IF and ELSE blocks are skipped.
15.

The condition of an IF statement evaluates to boolean only if the expression contains?

A. logical operators
B. relational operators
C. boolean operands
D. All
Answer» E.
16.

State TRUE or FALSE. An ELSE or ELSE-IF statement in Java can not exist alone without IF statement.

A. FALSE
B. TRUE
C. -
D. -
Answer» C. -
17.

State TRUE of FALSE. The code inside an ELSE statement may be surrounded by Braces.

A. FALSE
B. TRUE
C. -
D. -
Answer» C. -
18.

State TRUE or FALSE. An IF statement code must be defined in between two Braces.

A. FALSE
B. TRUE
C. -
D. -
Answer» B. TRUE
19.

State TRUE or FALSE. A Single-Line comment or Multiline-comment is allowed in between if () and Left Brace ( { ).

A. FALSE
B. TRUE
C. -
D. -
Answer» C. -
20.

An ELSE statement must be preceded by ___ statement in Java.

A. IF
B. ELSE IF
C. IF or ELSE IF
D. None
Answer» D. None
21.

State TRUE or FALSE. Every IF statement must be followed by an ELSE of ELSE-IF statement.

A. TRUE
B. FALSE
C. -
D. -
Answer» C. -
22.

Java style IF-ELSE statements are similar to ___.

A. C style
B. C++ Style
C. Both C and C++ style
D. None
Answer» D. None
23.

An IF statement in Java is also a ___ statement.

A. boolean
B. conditional
C. iterative
D. optional
Answer» C. iterative
24.

An IF or ELSE IF statement accepts ___ as input before branching.

A. boolean
B. int
C. float
D. char
Answer» B. int
25.

An IF-ELSE statement is also called ___.

A. Branching statement
B. Control statement
C. Block statements
D. All
Answer» E.
26.

1 2 3 4 5 6 7 8 9

A. 0 1 2 3 4 5 6 7 8
B. 0 1 2 3
C. 0 1 2 3 4
Answer» D.
27.

In if

A. In else
B. In if
C.
Answer» D.