C Array Questions and Answers
Practice ModeShowing 10 of 108 questions
Q21
Find the output
void main ( )
{
int a[ ]={6, 7, 8, 9}, i;
compute (a);
for (i=3, i>=0; i--)
printf("%d", a[i]);
}
computer (int *p)
{
int i;
for (i=0; i<4; i++){
*p=*p-1;
p++;
}
}
Answer: Option C
Q22
Find the output
void main ()
{
char *s [ ] ={"very""good""boy"}'
printf("%s", s[0];
}
Answer: Option B
Q23
Find the output
void main ()
{
int a[ ]={'1','2','3', '4', '5'}, i,
for {i=0; i<5; i++)
printf("%c",a[i]);
}
Answer: Option B
Q24
An array of mat [10][10] is given. What will be the number of adjacent element of mat[0][0];
Answer: Option A
Q25
Find the output
void main ( )
{
ffloat a [ ]={3.4, 5.7, 4.2, 8};
int i;
for (i=0; i<4;i++)
printf(%d", a[i]);
}
Answer: Option C
Q26
Find the outpu
void main ( )
{
vhar a[ ] ={'ra', 'ma');
int i;
for (i=0; i<sizeof (a)/
sizeof (char); i++
printf("%c", a[i]);
}
Answer: Option A
Q27
Find the output
void main ()
{
int a [ ]= {1, 2, 3, 4, 5} ,i;
for (i=4; i>0;)
printf("%d", a[i--]);
}
Answer: Option C
Q28
Find the output
void main ( )
{
char a[5]={'c', 'i', 't','e',o};
printf("%s", a[4]);
}
Answer: Option B
Q29
Which of the following array can be read s a single entity?
Answer: Option D
Q30
Find the output
void main ()
{
int a[2] [2] [3]={{1, 2, 3, 6, 7, 8},
{5, 7, 9, 3, 4, 1}};
printf("%d", *(*(*(a+1) +1)+1));
}
Answer: Option C