Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    void count(char *ptr)
    {
    ptr++;
    ptr[3] = 'S';
    }
    void main()
    {
    char str[] = "AJIT";
    count(str);
    printf("%c\n", *str);
    }
    1. A
    2. AJIT
    3. Compilation Error
    4. Garbage value
    5. None of these
Correct Option: A

A



Your comments will be displayed only after manual approval.