ch2-Hello

Chapter_2     Declare Exercise_2-1







Hello.cpp     TCP1, p. 103         download


// Saying Hello with C++
#include <iostream> // Stream declarations
using std::cout;
using std::endl;

int main()
{
cout << "Hello, world! I am "
<< 8 << " today!" << endl;
}
/*
g++ Hello.cpp -o Hello
./Hello
Hello, world! I am 8 today!
*/





Note:

Number 8 is printed as a string, so we could have written instead
<< "8 today!" << endl;









Chapter_2     Declare BACK_TO_TOP Exercise_2-1



Comments

Popular posts from this blog

Contents