Arrays

Q1: What will be the output of the program ?
#include<stdio.h>

int main()
{
    int arr[1]={10};
    printf('%d\n', 0[arr]);
    return 0;
}

A 10

B 0

C 1

D 6

ANS:A - 1

Step 1: int arr[1]={10}; The variable arr[1] is declared as an integer array with size '2' and it's first element is initialized to value '10'(means arr[0]=10) Step 2: printf('%d\n', 0[arr]); It prints the first element value of the variable arr. Hence the output of the program is 10.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.