Computer Programming (3310701) MCQs

MCQs of Introduction of Array (One Dimensional)

Showing 11 to 20 out of 34 Questions
11.

Array can be considered as set of elements stored in sequential memory locations but having __________.

એરે ને ____________ ધરાવતા સિક્વન્સીઅલ મેમરી લોકેશન્સ માં સ્ટોર થયેલા એલિમેન્ટ્સ ના સમૂહ તરીકે કન્સિડર કરી શકાય.

(a)

Same data type

(b)

Different data type

(c)

Same scope

(d)

Different scope

Answer:

Option (a)

12.

What is the output of this C code?

void main()
{
      int arr[10];
      printf("%d %d", arr[-2], arr[11]);
}

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

void main()
{
      int arr[10];
      printf("%d %d", arr[-2], arr[11]);
}

(a)

0 0

(b)

Garbage value 0

(c)

Garbage value Garbage value

(d)

Compile time error

Answer:

Option (c)

13.

What is the output of this C code?

#include <stdio.h>
void main()
{
    int a[1]={100};
    printf("%d", a[0]);
}

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

#include <stdio.h>
void main()
{
    int a[1]={100};
    printf("%d", a[0]);
}

(a)

100

(b)

0

(c)

Garbage Value

(d)

Compile time error

Answer:

Option (a)

14.

Which is true about the given statment ?

int arr[10] = {0,1,2,[7]=7,8,9};

આપેલા સ્ટેટમેન્ટ માટે સાચું શું હશે?

int arr[10] = {0,1,2,[7]=7,8,9};

(a)

Compile time error

(b)

Run-time Error

(c)

This is allowed in C

Answer:

Option (c)

15.

What is the value of a[4]?

int a[5]={1,2,4,1,0};

a[4] ની વેલ્યુ શું હશે?

int a[5]={1,2,4,1,0};

(a)

1

(b)

10

(c)

0

(d)

Error

Answer:

Option (c)

16.

What is the output of this C code?

void main() 

       int a[3] = {20,30,40}; 
       int b[3]; 
       b=a; 
       printf("%d", b[0]); 
}

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

void main() 

       int a[3] = {20,30,40}; 
       int b[3]; 
       b=a; 
       printf("%d", b[0]); 
}

(a)

Compiler error

(b)

20

(c)

30

(d)

0

Answer:

Option (a)

17.

What is the output of this C code?

#include<stdio.h>

void main()
{
    int arr[1]={10};
    printf("%d\n",arr[0]);
}

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

#include<stdio.h>

void main()
{
    int arr[1]={10};
    printf("%d\n",arr[0]);
}

(a)

1

(b)

10

(c)

6

(d)

8

Answer:

Option (b)

18.

What is the index number of the last element of an array with 29 elements?

29 એલિમેન્ટ્સ વાળા એરેના છેલ્લા એલિમેન્ટ ની index  શું હશે?

(a)

29

(b)

28

(c)

0

(d)

Programmer-defined

Answer:

Option (b)

19.

Which of the following is a two-dimensional array?

નીચેનામાંથી કયું ટુ-ડાઈમેન્સનલ એરે છે?

(a)

array anarray[20][20];

(b)

int anarray[20][20];

(c)

int array[20, 20];

(d)

char array[20];

Answer:

Option (b)

20.

In the declaration given below, what is "array"?

int array[20];

નીચે આપેલા ડીક્લેરેશન માં, "array" શું છે?

int array[20];

(a)

Keyword

(b)

Identifier

(c)

Literal

(d)

Operator

Answer:

Option (b)

Showing 11 to 20 out of 34 Questions