GATE CS 2019 (Forenoon) — Question 63

Programming in CPointers, Multi-Dimensional Arrays, StructuresNAT2 marksMedium

Consider the following C program:
c
1#include <stdio.h>
2int main ( )
3{
4    int a[ ] = {2, 4, 6, 8, 10};
5    int i, sum = 0, *b = a + 4;
6    for (i = 0; i < 5; i++)
7        sum = sum + (*b - i) - *(b - i);
8    printf ("%d\n", sum);
9    return 0;
10}
11
The output of the above C program is ________.
Practise the full 2019-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.
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