C Array Questions and Answers

Practice Mode
Showing 10 of 108 questions
Q51
The maximum number of non-zero elements in the ith row in a lower trinangular array with in rows is
  • A i
  • B i+1
  • C n
  • D None of the above
Answer: Option C
Q52
An array is caled sparse array in which
  • A None of the elements are zero
  • B Maximum numbers of elements of arrays are zero.
  • C All the elements of arrays are zero.
  • D None of the above
Answer: Option B
Q53
 Find the output. void main ( ) { int a[ ]= {1, 2, 3, 4, 5}; printf ("%", &a[5]-&a[1]); }
  • A 4
  • B 8
  • C 3
  • D Garbage value
Answer: Option A
Q54
Find the output void main ( ) short *a[5]; printf (%d", sizeof (a)); }
  • A error, pointer an't be declared like that
  • B 2
  • C 10
  • D Garbage value
Answer: Option C
Q55
Find the correct statement.
  • A int a=10; int arr[a];
  • B int *p={&a,&b,&c};
  • C static int a,b,c; int *q[ ]={&a, &b}
  • D int a=1, b=2, c=3; int arr[ ]={a, b, c};
Answer: Option C
Q56
Find the output. void main () { int a[ ]={1, 2, 3, 4, 5, 6, 7, 8, 9} printf ("%", a[2, 3, 5}); }
  • A 6
  • B 3
  • C 346
  • D Compilation error
Answer: Option A
Q57
Find the output. void main () { int i,j; int matrix [ ] [3]=(1, 2, 3, 4, 5, 6, 7, 8, 9); for (i=1; i<=2; i++) for (j=1; j<=2;j++) printf("%d", *(*matrix+j)+1); }
  • A 1479
  • B 5869
  • C 4567
  • D None of these
Answer: Option D
Q58
Find the output void main () { char *p, *q, *r; p="abc"; q="defg hijk"; r="1mno"; strncat(p, strrev (q), strlen (r)); printf("%s",p); }
  • A abcgfed
  • B abckjih
  • C abcdefg
  • D cbagfed
Answer: Option B
Q59
Find the output void main () { char c[ ]={'1','2','3','4'},*p; p=&c[2]; printf("%d",++(*p)); }
  • A 3
  • B 21
  • C 4
  • D None of these
Answer: Option D
Q60
Find the output. void main ( ) { char *p="CITE"; char *q="CITE"; if (p==q) printf("Both are equal"); else printf("Not equal"); }
  • A Both are equal
  • B Not equal
  • C Error
  • D None of these
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test