Pointers


  1. Which of the following declaration is illegal?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    int size = 5;
    int num[size] = {11, 12, 13, 14, 15};


  1. What are the elements present in the array of the following C code?
    int num[4] = {10};











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    10, 0, 0, 0



  1. What are the different ways to initialize an array with all elements as zero?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Option A, B and C are the different ways to initialize an array with all elements as zero.


  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    const int num[5] = {11, 21, 31, 41, 51};
    int *ptr;
    ptr = num + 3;
    *ptr = 50;
    printf("%d\n", num[3]);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    50



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int num[6] = {6, 7, 8, 9, 10};
    printf("%d\n", *num);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    6