C Array Questions and Answers

Practice Mode
Showing 10 of 108 questions
Q91
Find the output void main () { char *p; char b[10]={1, 2, 3, 4, 5, 6, 7, 8}; p=(b+1) [5]; printf("%d",p); }
  • A 9
  • B 7
  • C Compilation error
  • D None of these
Answer: Option B
Q92
Find the output void main ( ) { char s [ ]="041"; int x; x=atoi (s) ; printf("%d", x); }
  • A 041
  • B 41
  • C 0
  • D None of these
Answer: Option B
Q93
Find the output void main ( ) { int a[ ][3]={1,2,3,4, 0, 6}; orubtf(%d %d", *(*a+1)); }
  • A 2 4
  • B 4 2
  • C 2 2
  • D None of these
Answer: Option A
Q94
Find the output void main ( ) { char a[5]="Good night"; printf("%s", a); }
  • A Good
  • B Good night
  • C Compilation error
  • D None of these
Answer: Option C
Q95
Find the output void main ( ) { int a[2] [2] [2] ={1, 2, 3, 4, 5, 6, 7, 8); printff("%d", *(a[0])); }
  • A The value of a[0][0][0]
  • B The value of a[1][1][1]
  • C The address off a[0][0][0]
  • D The address of a a[1][1][1]
Answer: Option C
Q96
Find the output void main ( ) { int a[5]; int *p=&a[3]; p[-2]=5; [[-1]=10; p[-3]=15; printf("%d", p[2]); }
  • A 10
  • B 15
  • C 5
  • D Garbage value
Answer: Option D
Q97
Find the output void main ( ) { char *s [ ]="rabi", "manoj", "bubu"}; printf("%s %s %s", *s, ++*s, *(s+2)); }
  • A rabi manoj bubu
  • B bubu majoj rabi
  • C abi abi bubu
  • D rabi abi bubu
Answer: Option C
Q98
Find the output int a[ ]={3, 7, 9, 11}, count; call ( ) { return ++count; } void main ( ) { a[count++]=call (); printf("%d", a[count]); }
  • A 1
  • B 2
  • C 3
  • D None of these
Answer: Option D
Q99
Find the output void main ( ) { char ch [ ]=?welcome"; omt o=0; while (i<strlen (ch)) putchar (ch[i++] | 32); }
  • A welcome
  • B WELCOME
  • C Welcome
  • D None of these
Answer: Option A
Q100
Find the output. void main() { int arr[5]= { }, i; char *p; for (i=0; i<5,i++) arr [i]=i; p=(char*) arr; printf("%d %d", p, arr+1); }
  • A 1 2
  • B 1 3
  • C Garbage garbage
  • D Compilation error
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test