This Blog is for New Computer Prgrammers

Saturday, 3 December 2016

Hello World in C - Language

So dear ones Time to jump into the wonderland of C-Language, Going to describe you the very First Program in C - Language, that is must to enter otherwise there is no program in C - Language at all.

#include<stdio.h>
#include<conio.h>

void main(void)
{
clrscr();
pritnf("Hello World");
getch();
}

Here is the details about above mentioned program

Header Files
Remember one thing that all functionality of C - Language is stored inside some special Files called Header Files. Header Files have extension .h and are stored in include folder inside TC Folder when you install C Compiler.

Preprocessor Directives

# sign indicates the preprocessor directive, we have two preprocessor directives in C - Lanugage

  • include 
  • define


Include is used to add Header Files functionality in your program, and define is used to define Constants in C - Language

every C Program must start with preprocessor directive statements.

Main Function

Every Language starts its program from somewhere, so is the C Language, C Language Starts its Program from main function, the whole program is controlled from main function

Function Body
{ } Braces define the body of the function

inside the Body of the function we write our statements, 

clrscr() ; 
this statement clears the output screen

printf();
this statement writes the text given in double quotes on output screen

getch();
this statement is used to pause of output screen, it stays there until user presses any key from keyboard.


Role of Semicolon.
Semicolon is called statement terminator, so every C Language statement must end at Semicolon.

Share:

4 comments:

  1. "Hello world" is first program in any programming language.

    ReplyDelete
  2. very nice http://urdugraphic.blogspot.com/2016/12/corl-tools.html

    ReplyDelete

Total Pageviews