Here are a few programs we tried in class on 4 September.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, C++!";
return 0;
}
Using \n
to represent a new line.
#include <iostream>
using namespace std;
int main()
{
cout << "Alice and\nBob were\n";
cout << "here.";
return 0;
}
Using \"
to print a double quote.
#include <iostream>
using namespace std;
int main()
{
cout << "\"That's the problem,\" said Bjarne.";
return 0;
}