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<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