-
What is the output of this program?
#include <iostream>
using namespace std;
int main()
{
int num;
int *ptr;
num = 12;
ptr = #
cout << *ptr;
return 0;
}
-
- 0
- 12
- Compilation Error
- Runtime Error
- None of these
Correct Option: B
In this program, we are copying the memory location of num into ptr and then printing the value in the address.