GATE CS 2024 (Afternoon) — Question 36

Programming in CPointers, Multi-Dimensional Arrays, StructuresMCQ2 marks · −2/3 if wrongMedium

What is the output of the following C program?
c
1#include <stdio.h>
2int main() {
3    double a[2]={20.0,25.0},*p, *q;
4    p = a;
5    q = p + 1;
6    printf ("%d, %d",(int)(q - p),(int)(*q - *p));
7    return 0;
8}
9
  1. A
    4, 8
  2. B
    1, 5
  3. C
    8, 5
  4. D
    1, 8
Practise the full 2024-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAFree All-India Mock — every SundayA full GATE CS paper, exactly 180 minutes, ranked across India with your GATE score.
Practise more on Pointers, Multi-Dimensional Arrays, StructuresTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group