What is the output of the following C program? #include <stdio.h> int main() {…

GATE · 2024 · CS · Set 2 · Computer Science & IT

What is the output of the following C program?

#include <stdio.h>

int main() {

double a[2]={20.0, 25.0}, *p, *q;

p = a; q = p + 1;

printf(”%d,%d”, (int)(q – p), (int)(*q – *p));

return 0;

}

  1. A.

    4,8

  2. B.

    1,5

  3. C.

    8,5

  4. D.

    1,8

Attempted by 320 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…