Vidyalelo
C++ Programming · Q159

C++ miscellaneous

Programming · C++ Programming · question 159

Q159

What will be the output of the following C++ code? #include #include using namespace std; int main() float val = 5.5; any var(val); cout (var)<<endl; var.reset(); if(!var.has_value()) cout<<"var is empty "; else cout<<"var is not empty "; return 0;

A.
var is empty
B.
5.5
var is not empty
C.
5.5
D.
5.5
var is empty
Answer

Answer: Option D

Solution

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