Computer Sciences > Gate 2022 > C Programming
What is printed by the following ANSI C program?
#include<stdio.h>
int main(int argc, char *argv[])
{
    int a[3][3][3] =
    {{1, 2, 3, 4, 5, 6, 7, 8, 9},
    {10, 11, 12, 13, 14, 15, 16, 17, 18},
    {19, 20, 21, 22, 23, 24, 25, 26, 27}};
    int i = 0, j = 0, k = 0;
    for( i = 0; i < 3; i++ ){
        for(k = 0; k < 3; k++)
            printf(“%d”, a[i][j][k]);
       printf (“\n”);
}
A
1  2  3
10 11 12
19 20 21
B
1  4   7
10 13 16
19 22 25
C
1 2 3
4 5 6
7 8 9
D
1   2   3
13 14 15
25 26 27

Correct : a

Similar Questions

Consider the following two functions void fun1(int n){ &nbsp; &nbsp; if(n == 0) return; &nbsp; &nbsp; &nbsp; printf(“%d”, n); &nbsp; &nbsp; fun2(n-2); &...
#175 MCQ
Consider the C functions foo and bar given below: int foo(int val) { &nbsp; &nbsp; int x = 0; &nbsp; &nbsp; while (val > 0) &nbsp; &nbsp; { &nbsp; &nbsp; &nbs...
#190 MCQ
Consider the following C program: #include&lt;stdio.h&gt; int main() { &nbsp; &nbsp; int a[] = {2, 4, 6, 8, 10}; &nbsp; &nbsp; int i, sum = 0, *b = a + 4; &...
#612 Fill in the Blanks

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......