C++ Comments and Hello World Question

Question

Write a program that has a comment in it, outputs "Hello World." on one line, and "C++ rocks!" on a new line.



#include <iostream> 

int main() 
{ 
    // this is a comment 
    std::cout << "Hello World." << '\n'; 
    std::cout << "C++ rocks!"; 
} 



PreviousNext

Related