adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
        float num1 = 1.1;
        double num2 = 1.1;
        if (num1 == num2)
           cout << "stanford";
        else
           cout << "harvard";
        return 0;
    }

a.

harvard

b.

stanford

c.

compile time error

d.

runtime error

Answer: (a).harvard

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. Which is used to indicate single precision value?

Q. The size of an object or a type can be determined using which operator?

Q. It is guaranteed that a ____ has atleast 8bits and a ____ has atleast 16 bits.

Q. Implementation dependent aspects about an implementation can be found in ____

Q. Size of C++ objects are expressed in terms of multiples of the size of a ____ and the size of a char is _______

Q. Identify the incorrect option.

Q. Which of the following will not return a value?

Q. ____ have the return type void?

Q. What does the following statement mean?
void a;

Q. Choose the incorrect option

Q. Identify the incorrect option.

Q. In which type does the enumerators are stored by the compiler?

Q. To which of these enumerators can be assigned?

Q. What will happen when defining the enumerated type?

Q. Which variable does equals in size with enum variable?

Q. Choose the correct option.

extern int i;
int i;

Q. Pick the right option:

Statement 1:A definition is also a declaration.
Statement 2:An identifier can be declared just once.

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;

Q. Pick the right option:

Statement 1:Global values are not initialized by the stream.
Statement 2:Local values are implicitly initialised to 0.

Q. Can two functions declare variables(non static) with the same name.