Computer Programming (3310701) MCQs

MCQs of Decision Statements

Showing 11 to 20 out of 26 Questions
11.

In switch statement, _______ is written after every case.

સ્વીચ સ્ટેટમેન્ટમાં, દરેક કેસ પછી _______  લખાયેલું હોય છે.

(a)

break

(b)

continue

(c)

goto

(d)

default

Answer:

Option (a)

12.

Branching statement, goto is a __________ .

બ્રાંચિંગ સ્ટેટમેન્ટ, goto એ __________ છે.

(a)

conditional

(b)

unconditional

Answer:

Option (b)

13.

In the code fragment shown below, which type of jump is used?

Label : statement;
.
.
Goto label;

નીચે બતાવેલ કોડ ફ્રેગમેન્ટમાં, કયા પ્રકારનો જંપ યુસ થયેલો છે?

Label : statement;
.
.
Goto label;

(a)

Forward jump

(b)

Backward jump

Answer:

Option (b)

14.

To use sqrt() function we need to include ________ header file.

Sqrt() ફંકશનનો ઉપયોગ કરવા માટે આપણે ___________ હેડર ફાઇલ include કરવી પડે છે.

(a)

stdio.h

(b)

conio.h

(c)

string.h

(d)

math.h

Answer:

Option (d)

15.

What is the output of this C code?

#include<stdio.h>
void main()
{
    int x=3;
    float y=3.0;
    if(x==y)
           printf("x and y are equal");
    else
           printf("x and y are not equal");
}

આપેલા C કોડનું આઉટપુટ શું હશે?

#include<stdio.h>
void main()
{
    int x=3;
    float y=3.0;
    if(x==y)
           printf("x and y are equal");
    else
           printf("x and y are not equal");
}

(a)

x and y are equal

(b)

x and y are not equal

(c)

Unpredictable

(d)

No output

Answer:

Option (a)

16.

The keyword ‘break’ cannot be simply used within _________ .

‘break’ કીવર્ડ નો ઉપયોગ _________ ની અંદર થઈ શકતો નથી.

(a)

do-while

(b)

if-else

(c)

for

(d)

while

Answer:

Option (b)

17.

What is the output of this C code?

#include <stdio.h>
void main()
{
         int i = 0;
         if (i == 0)
         {
                  goto label;
         }
         label: printf("Hello");
}

આપેલા C કોડનું આઉટપુટ શું હશે?

#include <stdio.h>
void main()
{
         int i = 0;
         if (i == 0)
         {
                  goto label;
         }
         label: printf("Hello");
}

(a)

Nothing

(b)

Error

(c)

Infinite Hello

(d)

Hello

Answer:

Option (d)

18.

A "switch" statement is used to ____________ .

"switch" સ્ટેટમેન્ટનો ઉપયોગ ________ માટે થાય છે.

(a)

Switch between functions in a program

પ્રોગ્રામમાં ફંકશન્સ વચ્ચે switch કરવા માટે

(b)

Switch from one variable to another variable

એક વેરીએબલ થી બીજા વેરીએબલ વચ્ચે switch કરવા માટે

(c)

To choose from multiple possibilities which may arise due to different values of a single variable 

એક વેરીએબલ ની વિવિધ વેલ્યુ પસંદ કરવા માટેની multiple possibilities ઉભી થાય ત્યારે

Answer:

Option (c)

19.

What is the output of this C code?

int a=5;
    
 if (a == 0) 
      printf ("a is zero");
 else 
      printf ("a is not zero"); 

આપેલા C કોડનું આઉટપુટ શું હશે?

int a=5;
    
 if (a == 0) 
      printf ("a is zero");
 else 
      printf ("a is not zero"); 

(a)

a is zero

(b)

a is not zero

(c)

nothing

(d)

garbage

Answer:

Option (b)

20.

What is the output of this C code?

int a=7;
if ( a == 7 )
printf (" a is seven ");
else
printf (" a is not seven ");

આપેલા C કોડનું આઉટપુટ શું હશે?

int a=7;
if ( a == 7 )
printf (" a is seven ");
else
printf (" a is not seven ");

(a)

a is seven

(b)

a is not seven

(c)

nothing

(d)

garbage

Answer:

Option (a)

Showing 11 to 20 out of 26 Questions