Saturday, January 23, 2010

A Simple C++ Program

Namespace Wikipedia.2Image via Wikipedia
This is the simples C++ program. It displays a sentence on the console or the terminal
Version 1
#include <iostream>
using namespace std;

int main()
{
std::cout << "Welcome to the wonderful world of C++!!!\n";

return 0;

}
Version 2
#include <iostream>
using namespace std;

int main()
{
cout << "Welcome to the wonderful world of C++!!!\n";

return 0;
}

Here is an example of running the program:
Welcome to the wonderful world of C++!!!

| More

0 comments:

Post a Comment

Related Posts with Thumbnails