A

Admin • 833K Points
Coach

Q. #include <stdio.h>

int main()
{
int x[5] = { 10, 20, 30 };
printf("%d", x[-1]);
return 0;
}

  • (A) 0
  • (B) 10
  • (C) Garbage value
  • (D) Error
  • Correct Answer - Option(C)
  • Views: 28
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

C language compiler does not check array with its bounds, when an index is out of the range the garbage value is printed.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.