MCQ Single Best Answer Moderate

QOutput?

#include 
int main() {
    int a[3] = {1,2,3};
    printf("%d", a[3]);
    return 0;
}

ID: #24917 SEMESTER – I - COMS - Unit – 3: Section 4: Introduction to C: Arrays and Structure 1 views
Question Info
#24917Q ID
ModerateDifficulty
SEMESTER – I - COMS - Unit – 3: Section 4: Introduction to C: Arrays and StructureTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 3
  • C Garbage value
  • D 1
Correct Answer: Option C

Explanation

a[3] হলো out of bound access।

Valid index: 0,1,2

Output: Undefined / Garbage value

Share This Question

Challenge a friend or share with your study group.