Pointers


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *str = "PRAYAG";
    char *ptr = str;
    printf("%c %c", *ptr, str[2]);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    P A


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *str = "AJIT";
    char *ptr = str;
    printf("%c %c", *(ptr + 2), str[2]);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    I I



  1. Which of following logical operation can be applied to pointers?
    (Assuming initialization int *p = 12; int *q = 13;)











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    None of these


  1. What is the size of *p in a 32-bit machine (Assuming initialization as int *p = 12;)?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    4



  1. Which of the following arithmetic operation can be applied to pointers p and q?
    (Assuming initialization as int *p = (int *)6; int *q = (int *)7;)











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    p – q