LogiQuest
Back to Pointers
4

What will be the output of the program?

#include <stdio.h>

int main(void) {
    int arr[5] = {1, 2, 3, 4, 5};
    int *p = &arr[1], *q = &arr[4];
    printf("%td\n", q - p);
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.