C Array Questions and Answers
Practice ModeShowing 10 of 108 questions
Q41
In case of an upper triangular array whoch of the following is true.
Answer: Option C
Q42
Find the output
void main ( )
{
int x [ ] ={5, 6, 7, 8, 9};
printf("%d %d", (x+1) [0], (x-1)[2]);
}
Answer: Option A
Q43
Find the out the difference between the address of array and address of the first element of array
Answer: Option B
Q44
Find the output
void main ( )
{
int a[] [3] = { 1, 3, 5, 4, 7, 9};
printf("%d %d", *(*(a+0) +0, *(*(a+1) +1));
}
Answer: Option B
Q45
Find the output
void main ()
{
int x=5;
char a[x]={'a','b','d'};
printf ("%c", ++1 [a]);
}
Answer: Option D
Q46
Find the outpu
void main ()
{
int *p;
int a [ ]={1, 2, 3, 4, 5, 6, 7, 8, 9};
p=(a+2) [2];
printf("%d", p);
}
Answer: Option C
Q47
Find the output
void main ( )
{
int i,j, a[10]={1, 2, 3, 34, 5, 6, 7, 8, 9, };
int b[10]={11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
++b [j=i=++a[1]];
while (j==i)
{
if (b[i]==9)
++b[--i];
else
b[(i<9)?++i:i]=b[j]+1;
++a[i];
}
printf("a'%d]=%u",i, a[i]);
}
Answer: Option B
Q48
Find the output
void main ( )
{
int a [3] [3], i, j, p, b=1;
for (i=0; j<3;i++)
for (j=0l j<3; j++)
a [i][j]=++b;
p=*(*(a+2)-3);
p=*(*(a+2)-3);
printf("%d",p);
}
Answer: Option A
Q49
Find the output
voia main ( )
{
int a[ ] = {1, 2, 3, 4, 5};
int *p=(int *) (&a+1);
printf("%d %d", *(a+1), *(p-1);
}
Answer: Option C
Q50
Which of the following statements results an error of 1value required ?
1. void main (){
2. int a[ ] ={1, 2, 3, 4, 5};
3. int (*p) [5], *q[5];
4. p=a;
5. q=a;
6. p=&a;
7. q=&a;
8. }
Answer: Option B