adplus-dvertising
frame-decoration

Question

What is the output of the following program?
    #include <iostream>
    using namespace std;
    int main()
    {
        int num = 0x20 + 020 + 20;
        cout << sizeof(num)<<'\n';
        return 0;
    }

a.

2

b.

4

c.

Depends on compiler

d.

Garbage

Answer: (c).Depends on compiler

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 the following program?

Similar Questions

Discover Related MCQs

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.

Q. Identify the incorrect statements.

int var = 10;
int *ptr = &(var + 1); //statement 1
int *ptr2 = &var; //statement 2
&var = 40; //statement 3

Q. Identify the type of the variables.

typedef char* CHAR;
CHAR p,q;

Q. Evaluate the following expression:
3 >6&&7>4

Q. Special data types that are defined by users is called

Q. In C++ the words that is already defined and is reserved for a single special purpose, is called as

Q. There are how many relational operator are offered by C++?