Computer Programming (3310701) MCQs

MCQs of Decision Statements

Showing 1 to 10 out of 26 Questions
1.

____________ is multiway decision statement.

____________ એ મલ્ટિવે ડિસીઝન સ્ટેટમેન્ટ છે.

(a)

for

(b)

switch

(c)

if

(d)

while

Answer:

Option (b)

2.

The default case is compulsory in the switch case statement.

સ્વિચ કેસ સ્ટેટમેન્ટમાં ડિફોલ્ટ કેસ કમ્પલસરી છે.

(a)

TRUE

(b)

FALSE

Answer:

Option (a)

3.

Case label in switch statement must be constants only.

સ્વીચ સ્ટેટમેન્ટમાં કેસ લેબલ ફક્ત કોન્સ્ટન્ટ હોવા જોઈએ.

(a)

TRUE

(b)

FALSE

Answer:

Option (b)

4.

A program stops its execution when break statement is encountered.

જ્યારે બ્રેક સ્ટેટમેન્ટ એન્કાઉન્ટર થાય ત્યારે પ્રોગ્રામ તેનું એકઝીક્યુસન બંધ થઈ જાય છે.

(a)

TRUE

(b)

FALSE

Answer:

Option (b)

5.

The continue statement cannot be used with ___________ .

Continue સ્ટેટમેન્ટનો ઉપયોગ કોની _________ સાથે કરી શકાતો નથી.

(a)

for

(b)

while

(c)

do while

(d)

switch

Answer:

Option (d)

6.

Which of the following is an invalid if-else statement?

નીચેનામાંથી કયું invalid if-else statement છે?

(a)

if (if (a == 1))
{
      //statements
}

(b)

if (a)
{
       //statements
}

(c)

if ((char) a)
{
        //statements
}

(d)

if (func1 (a))
{
        //statements
}

Answer:

Option (a)

7.

A labeled statement consist of an identifier followed by ___________ .

લેબલવાળા સ્ટેટમેન્ટ માં _________ આઇડેન્ટીફાયર નો ઉપયોગ કરવામાં આવે છે.

(a)

;

(b)

:

(c)

,

(d)

=

Answer:

Option (b)

8.

In if statement it is compulsory to write the condition within brackets _______ .

if સ્ટેટમેન્ટ માં _________ બ્રેકેટની અંદર કન્ડિશન લખવી ફરજિયાત છે.

(a)

< >

(b)

( )

(c)

{ }

(d)

[ ]

Answer:

Option (b)

9.

Switch statement is an alternative to _______ .

સ્વીચ સ્ટેટમેન્ટ એ ________ માટે એક અલ્ટર્નેટીવ છે.

(a)

if statement

(b)

if…else statement

(c)

multiple…if else statement

Answer:

Option (c)

10.

In switch statement, the value of variable or expression must be _______ .

સ્વીચ સ્ટેટમેન્ટમાં, વેરીએબલ અથવા એક્સપ્રેશનની વેલ્યુ __________ હોવી જોઈએ.

(a)

int

(b)

char

(c)

can be either int or char

(d)

can be any value

Answer:

Option (c)

Showing 1 to 10 out of 26 Questions