Categories

Tuesday, September 25, 2012

C/C++ Hello World Programming Introduction

     One of the basics in programming is to create the mostly created program: the HELLO WORLD program.  The HELLO WORLD program is used as an introduction to the programming language you are about to use. Well, this article title is named "C/C++ Hello World Programming" so it does not hide that the programming language we are going to use is the C/C++ programming.
     For C/C++ programming, the compiler we are going to use is Borland's Turbo C compiler. To download and install Turbo C you can follow the instructions here.
     After downloading and installing Turbo C we can now proceed to the actual programming. To create a hello world program you will need to have these codes:
Hello World Program Output
  #include<stdio.h>
  #include<conio.h>

  void main()
    {
    printf("HELLO WORLD");
    getch();

    }
     After typing the code you will need to compile the code, the shortcut is ALT+F9. If the code doesn't have any errors you can run the program by pressing CTRL+F9.
     The '#INCLUDE' is used to import the library, which is in this case the 'STDIO.H' and the 'CONIO.H', to your program. The 'STDIO.H' library contains the 'PRINTF' 'function which enables to print the text/string inside the parentheses. The 'CONIO.H' library contains the 'GETCH' functions which waits for the user to press a button in the keyboard which in this case is used view the output of the program before it ends.

     Didn't understand a thing? If you are new to programming, I will explain the basic terms and concepts like the words function, library and others on my next post here.

No comments:

Post a Comment