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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Garbage value
Explanation: C language compiler does not check array with its bounds, when an index is out of the range the garbage value is printed.
Explanation by: Team MCQ Buddy
C language compiler does not check array with its bounds, when an index is out of the range the garbage value is printed.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
168
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Team MCQ Buddy
Publisher
πŸ“ˆ
84%
Success Rate