GATE CS 2025, set 2 · Question 62 · Programming and Data Structures · Numerical answer (NAT) · 2 marks · no negative marks

Consider the following C program:
#include <stdio.h> int main(){ int a; int arr[5] = {30,50,10}; int *ptr; ptr = &arr[0] + 1; a = *ptr; (*ptr)++; ptr++; printf("%d", a + (*ptr) + arr[1]); return 0; }
The output of the above program is ______. (Answer in integer)

Answer

Answer 111

Answer from the official GATE CS 2025 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes