221k views
3 votes
What will the following statement output?

cout << &num1;

A) The value stored in the variable called num1
B) The memory address of the variable called num1
C) The number 1
D) The string "&num1"
E) None of these

1 Answer

3 votes

Final answer:

B) The memory address of the variable called num1. The statement cout << &num1; will output the memory address of the variable called num1.

Step-by-step explanation:

The statement cout << &num1; will output the memory address of the variable called num1. The & symbol is used to denote the address-of operator in C++. When we use &num1 with the cout statement, it will print the memory address where the variable num1 is stored.

User Tradyblix
by
8.8k points