MCQ Single Best Answer Moderate

QOutput?

#include 
struct demo {
    int x;
    int y;
};

int main() {
    struct demo d = {5};
    printf("%d %d", d.x, d.y);
    return 0;
}

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

Explanation

Partial initialization হলে বাকি members 0 হয়ে যায়।

d.x = 5, d.y = 0

Output: 5 0

Share This Question

Challenge a friend or share with your study group.