Thursday, July 4, 2013

C++ : Hello World!

Writing Hello World program in C++

Hello world, this is the first program or the first step in learning on how to display a text. Text is very important to any program. It gives users idea on how to or what to do with the program. Anyway, we all know what is text for... LoL :)

To write a code, you can just use notepad or any text editor. But, it can't be a program until you compile it.
To make it simpler, we can just use a compiler to write and build a program. You can find several compilers around the internet, you can download and try each of them to see which one is better for you.
I use Dev C++ as  a compiler. You can download it here (download link).



Here is the code:


#include <iostream.h>
using namespace std;

int main()
{
  cout << "Hello Dude!";
  cin.get();
}

This code will just simply display "Hello Dude!". 
Don't be confused if its called Hello World program but we wrote "Hello Dude!". The main goal of this code, is to show you on how to display a text. You may say that this is just a simple codes to show a text, but this is very important in writing a program. Just imagine a keyboard without any characters printed on it. :)


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...