Vidyalelo
C++ Programming · Q6

Structures and Unions in C++

Programming · C++ Programming · question 6

Q6

What is the output of the following code: struct Student int roll; ; Student s1; s1.roll = 101; cout << s1.roll; in C++?

A.
Undefined behavior
B.
0
C.
Compilation error
D.
101
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board