GATE Assistant

Past questions › Computer Science and Information Technology › GATE 2021 set2

GATE 2021 set2 · CS · MCQ · 1 mark · Programming and Data Structures › C Programming Fundamentals

GATE 2021 set2 Computer Science and Information Technology question: Consider the following ANSI C program. code What is the output of the above program?

Consider the following ANSI C program.

#include <stdio.h>
int main(){
    int arr[4][5];
    int i, j;
    for (i=0; i<4; i++){
        for (j=0; j<5; j++){
            arr[i][j] = 10*i + j;
        }
    }
    printf("%d", *(arr[1] + 9));
    return 0;
}

What is the output of the above program?

  1. (A)

    14

  2. (B)

    20

  3. (C)

    24

  4. (D)

    30

Show answer

Official answer: C

Practise this question with exam-style marking

Discussion

No discussion yet.

Join the discussion