The variable myNum has the value 5. How to print a variable to the screen?
A. cout<< "My number is", myNum << endl;.
B. cout<< "My number is 5" << endl;.
C. cout<< My number is << myNum << endl;.
D. cout<< "My number is" << myNum << endl;.
Answer:D
The variable myNum has the value 5. How to print a variable to the screen?
A. cout<< "My number is", myNum << endl;. B. cout<< "My number is 5" << endl;. C. cout<< My number is << myNum << endl;. D. cout<< "My number is" << myNum << endl;.