Programming begins from an Hello World. This post will show you how to write a C++ program to print the text "Hello World!" on the screen.
#include <iostream.h>
#include <conio.h>
void main()
{
cout << "Hello World!";
getch();
}
The above program works on compilers which use the original C++ standard such as Turbo C++. For those who follow the latest C++ 11 standards, the code is as follows :
#include <iostream>
void main()
using namespace std;
{
cout << "Hello World!";
}
#include <iostream.h>
#include <conio.h>
void main()
{
cout << "Hello World!";
getch();
}
The above program works on compilers which use the original C++ standard such as Turbo C++. For those who follow the latest C++ 11 standards, the code is as follows :
#include <iostream>
void main()
using namespace std;
{
cout << "Hello World!";
}
No comments:
Post a Comment