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

Compilation Error

main.c: In function ‘main’:
main.c:5:12: error: lvalue required as increment operand
str++;



Your comments will be displayed only after manual approval.