Question
#include <iostream>
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
b.
not equal
c.
compile time error
d.
runtime error
Posted under Object Oriented Programming Using C++
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. The size of an object or a type can be determined using which operator?
View solution
Q. It is guaranteed that a ____ has atleast 8bits and a ____ has atleast 16 bits.
View solution
Q. Implementation dependent aspects about an implementation can be found in ____
View solution
Q. Size of C++ objects are expressed in terms of multiples of the size of a ____ and the size of a char is _______
View solution
Q. Identify the incorrect option.
View solution
Q. Which of the following will not return a value?
View solution
Q. ____ have the return type void?
View solution
Q. What does the following statement mean?
void a;
View solution
Q. Choose the incorrect option
View solution
Q. Identify the incorrect option.
View solution
Q. In which type does the enumerators are stored by the compiler?
View solution
Q. To which of these enumerators can be assigned?
View solution
Q. What will happen when defining the enumerated type?
View solution
Q. Which variable does equals in size with enum variable?
View solution
Q. Choose the correct option.
extern int i;
int i;
View solution
Q. Pick the right option:
Statement 1:A definition is also a declaration.
Statement 2:An identifier can be declared just once.
View solution
Q. Which of the given statements are false.
1. extern int func;
2. extern int func2(int,int);
3. int func2(int,int);
4. extern class foo;
View solution
Q. Pick the right option:
Statement 1:Global values are not initialized by the stream.
Statement 2:Local values are implicitly initialised to 0.
View solution
Q. Can two functions declare variables(non static) with the same name.
View solution
Q. Identify the incorrect statements.
int var = 10;
int *ptr = &(var + 1); //statement 1
int *ptr2 = &var; //statement 2
&var = 40; //statement 3
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!