19. | if an array is declared as a[10], then its elements will be stored as |
|||||||
|
20. | Consider the following program fragment: int table[2][4], i, j;
Which one of the following sentences is true?
|
|||||||
|
21. | main(){
int a[]={1,2};
printf("%d %d\n",a[0],a[1]);
a[1,0]=22;
printf("%d %d",a[0],a[1]);
}
|
|||||||
|
22. | What will be the output of the program ? #include
int main()
{
int a[5] = {5, 1, 15, 20, 25};
int i, j, m;
i = ++a[1];
j = a[1]++;
m = a[i++];
printf("%d, %d, %d", i, j, m);
return 0;
}
|
|||||||
|
23. | What will be the output of the program ? #include
int main()
{
static int a[2][2] = {1, 2, 3, 4};
int i, j;
static int *p[] = {(int*)a, (int*)a+1, (int*)a+2};
for(i=0; i<2; i++)
{
for(j=0; j<2; j++)
{
printf("%d, %d, %d, %d\n", *(*(p+i)+j), *(*(j+p)+i), *(*(i+p)+j), *(*(p+j)+i));
}
}
return 0;
}
|
|||||||
|
24. | What will be the output of the program ? #include
int main()
{
void fun(int, int[]);
int arr[] = {1, 2, 3, 4};
int i; fun(4, arr);
for(i=0; i<4; i++)
printf("%d,", arr[i]);
return 0;
}
void fun(int n, int arr[])
{
int *p=0; int i=0;
while(i++ < n) p = &arr[i];
*p=0;
}
|
|||||||
|
« previous
1
2
3
4
5
6
7
8
9
...next »