1. Question: What will be output if you will compile and execute the following c code?
    #include<stdio.h>
    int main(){
      int array[3]={5};
      int i;
      for(i=0;i<=2;i++)
      printf("%d ",array[i]); 
      return 0;
    }
    
     

    A
    5 garbage garbage

    B
    5 0 0

    C
    5 null null

    D
    Compiler error

    E
    None


    1. Twitter
    2. Details
  2. Question: What will be output if you will compile and execute the following c code?


    #include<stdio.h>
    int main(){
      int array[2][2][3]={0,1,2,3,4,5,6,7,8,9,10,11};
      printf("%d",array[1][0][2]);
      return 0;

    A
    4

    B
    5

    C
    6

    D
    7

    E
    8


    1. Twitter
    2. Details
  3. Question: What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array? 

    A
    The element will be set to 0.

    B
    The compiler would report an error.

    C
    The program may crash if some important data gets overwritten.

    D
    The array size would appropriately grow.


    1. Twitter
    2. Details
  4. Question: What does the following declaration mean? int (*ptr)[10]; 

    A
    ptr is array of pointers to 10 integers

    B
    ptr is a pointer to an array of 10 integers

    C
    ptr is an array of 10 integers

    D
    ptr is an pointer to array


    1. Twitter
    2. Details
  5. Question: In C, if you pass an array as an argument to a function, what actually gets passed? 

    A
    Value of elements in array

    B
    First element of the array

    C
    Base address of the array

    D
    Address of the last element of array


    1. Twitter
    2. Details