Computer Programming (3310701) MCQs

MCQs of Loop Control Statements

Showing 21 to 30 out of 39 Questions
21.

Which keyword is used to come out of a loop only for that iteration?

ફક્ત તે ઈટરેસન માટે લૂપમાંથી બહાર આવવા માટે કયા કીવર્ડનો ઉપયોગ થાય છે?

(a)

break

(b)

continue

(c)

return

Answer:

Option (b)

22.

What is the output of this C code?

#include <stdio.h>
void main()
{
           printf("%d ", 1);
           goto l1;
           printf("%d ", 2);
           l1:goto l2;
           printf("%d ", 3);
           l2:printf("%d ", 4);
}

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

#include <stdio.h>
void main()
{
           printf("%d ", 1);
           goto l1;
           printf("%d ", 2);
           l1:goto l2;
           printf("%d ", 3);
           l2:printf("%d ", 4);
}

(a)

1 4

(b)

Compilation error

(c)

1 2 4

(d)

1 3 4

Answer:

Option (a)

23.

What is the output of this C code?

#include <stdio.h>
void main()
{
          int i = 0, j = 0;
          while (i < 2)
          {
                   l1 : i++;
                   while (j < 3)
                   {
                             printf("Loop\n");
                             goto l1;
                   }
            }
}

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

#include <stdio.h>
void main()
{
          int i = 0, j = 0;
          while (i < 2)
          {
                   l1 : i++;
                   while (j < 3)
                   {
                             printf("Loop\n");
                             goto l1;
                   }
            }
}

(a)

Loop Loop

(b)

Compilation error

(c)

Loop Loop Loop Loop

(d)

Infinite Loop

Answer:

Option (d)

24.

What is the output of this C code?

#include <stdio.h>
void main()
{
          int i = 0, j = 0;
          l1: while (i < 2)
          {
                   i++;
                   while (j < 3)
                   {
                            printf("loop\n");
                            goto l1;
                    }
           }
}

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

#include <stdio.h>
void main()
{
          int i = 0, j = 0;
          l1: while (i < 2)
          {
                   i++;
                   while (j < 3)
                   {
                            printf("loop\n");
                            goto l1;
                    }
           }
}

(a)

Loop 
Loop

(b)

Compilation error

(c)

Loop 
Loop 
Loop 
Loop

(d)

Infinite Loop

Answer:

Option (a)

25.

What is the output of this C code?

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

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

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

(a)

0

(b)

Infinite 0

(c)

Nothing

(d)

Error

Answer:

Option (b)

26.

What is the output of this C code?

#include <stdio.h>
void main()
{
          int i = 5, k;
          if (i == 0)
          goto label;
          label: printf("%d", i);
          printf("Hey");
}

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

#include <stdio.h>
void main()
{
          int i = 5, k;
          if (i == 0)
          goto label;
          label: printf("%d", i);
          printf("Hey");
}

(a)

5

(b)

Hey

(c)

5 Hey

(d)

Nothing

Answer:

Option (c)

27.

goto can be used to jump from main() to within a function.

goto નો યુઝ main() થી ફંક્શનની અંદર જમ્પ કરવા માટે કરી શકાય.

(a)

TRUE

(b)

FALSE

Answer:

Option (b)

28.

What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?

x ની ફાઇનલ વેલ્યુ શું હશે જયારે આપેલો કોડ int x; for(x=0; x<10; x++) {} રન થશે?

(a)

10

(b)

9

(c)

0

(d)

1

Answer:

Option (a)

29.

Which is not a loop structure in C?

આપેલા માંથી ક્યુ લૂપ સ્ટ્રક્ચર C માં નથી?

(a)

for

(b)

Do while

(c)

while

(d)

Repeat Until

Answer:

Option (d)

30.

For loop in a C program, if the condition is missing __________ .

C પ્રોગ્રામમાં for લૂપ માટે, જો કન્ડિશન મિસિંગ હોય તો?

(a)

it is assumed to be present and taken to be false

તે પ્રેઝન્ટ હોવાનું assume કરવામાં આવે છે અને ખોટું હોવાનું માનવામાં આવે છે

(b)

it is assumed to be present and taken to the true 

તે પ્રેઝન્ટ હોવાનું assume કરવામાં આવે છે અને સાચું હોવાનું માનવામાં આવે છે

(c)

it result in a syntax error 

રિઝલ્ટ માં સિન્ટેક્સ એરર મળે છે

(d)

execution will be terminated abruptly

એકઝીક્યુસન અચાનક સમાપ્ત થશે

Answer:

Option (b)

Showing 21 to 30 out of 39 Questions