Vidyalelo
C++ Programming · Q115

Variables and Data Types in C++

Programming · C++ Programming · question 115

Q115

What will be the output of the following C++ code? #include using namespace std; int main() float f1 = 0.5; double f2 = 0.5; if (f1 == 0.5f) cout << "equal"; else cout << "not equal"; return 0;

A.
equal
Answer
B.
not equal
C.
compile time error
D.
runtime error

Answer: Option A

Solution

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