MCQ Single Best Answer Moderate

QOutput?

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

ID: #24914 SEMESTER – I - COMS - Unit – 3: Section 4: Introduction to C: Arrays and Structure 3 views
Question Info
#24914Q 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 1
  • B 2
  • C 3
  • D 4
Correct Answer: Option C

Explanation

Array indexing C ভাষায় 0 থেকে শুরু হয়।

Step Analysis:

  • a[0] = 1
  • a[1] = 2
  • a[2] = 3

Output: 3

কেন C সঠিক: a[2] মানে third element, যা 3।

কেন A, B, D ভুল: index mapping অনুযায়ী mismatch।

Share This Question

Challenge a friend or share with your study group.