Writing Hello World Program
To write a C program, we need a compiler. You can use compilers like DevC++ and CodeBlocks but Turbo C is indicated in our title, so we are going to use "Turbo C". I prefer using Turbo C because some codes doesn't work with the new compilers. You will see what I mean if you try to use different compilers. If you still don't have turbo c, you can download it here (link).
This is a basic program written in C Language. This program will just print the hello world text. It simply show you the basic structure of a program and the use of printf function.
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("HELLO WORLD");
getch();
}
that is used to create a program. It is used to allow the functions
that we use in every program.
clrscr() - it clears all previous text displayed.
Printf("hello world") - a function to display a text. The function
that is most important in every program.
getch() - without this, your program will just flash on your screen.
Output:
No comments:
Post a Comment