How To Print Hello World in C Language

Introduction

Necessity is the mother of all he invention which are taking place in this world . C was language was also written originally for programming under an operating system called UNIX, which it self later written in c only. C is the middle level, structure programming language it is also a procedural language because each and every statement in c should be written in procedure.

The C language was developed at Bell laboratories (Now AT & T ) in the early 19070’s by Denis M. Ritchie. The need behind an operating system, which cloud manage the I/O (input /output) device, allocates is storage, and schedules the running the running of other programs

Generally the operating systems are written into the assembly language. By writing in a high-level language, the logic it to do the programming in a platform independent environment.

C is a very popular programming language since its development till date. It is just because of its distinct features which makes it greater than other language. After c, there are lout of programming language which were developed, but no one of them has enough to completely replace c. Also we may say that, c is the mother

C program execution

C program begin execution with the first instruction in the main function. C program execute one statement at a time from top to bottom. A program execute from the first instruction in the main function ton the last statement in the main function unless control is transferred to another point in the program.

The first program in c

Each instruction in a c program  is written as separate statement. Therefore a complete c program will comprise of a series of statements. These statements must in the same order in which we wish them to be execute; unless of course the logic of the problem demands a deliberate ‘jump’ or transfer of the control to a statement which sequence.

However big a program, the following rules are applicable to all c statements

  1. Blank space may be inserted between to words to improve the readability of  the statement. However, no blank spaces are allowed within a variable, constant  or keywords.
  2. Usually all statement are entered in small  case letters.
  3. C has no specific rules for the position at which a statement is to be written. That’s why it is often called a free-for language.
  4. Any c statement always ends with a ( 😉  semi colon

Let us now write down a simple c program How To Print Hello World in C Language

/* This is a TechoRishi Tutorials */

/* print hello word in c */

Void Main ()

{

Printf (“ hello world”);

Getch();

}

 Now a few useful tip about program….

–  Comments about the program should be enclosed within /*———- */ for example the first two statement in our program are comments

–   Any number of  comments can given at any place in the program

–  Comments cannot be nested. For example
[su_highlight]/* cal of SI /* this is a TechnoRishi Tutorials 3/01/2014*/  */[/su_highlight]

–  A comments can be split over more than one line, as in,
[su_highlight]/* this is a crzyyy comments  */[/su_highlight]

Line by line explanation

Alehousea lot of comments are probably not necessary in this program, it is usually the case that programmers tend to use to few comments is rather than too many. Comments should be used at any place where there is possibility of confusion. We will referring from repeating the standard lecture on how adequate number of comments can save hours of misery and suffering when you later try figure out what the program does

 

Void () > A  function return type of the main() function what program return to the compiler

Main() >  A the function type that don’t have any arguments

{   > open brace

Printf  > this is a print statement it’s a output function that print a variable values or staring

“ hello world ” > you can put any this between these its take a as a string

 Getch()  > that is a input function after run time that wait for the one charter. Its use for holding a out put screen you can see the out if you not declare that you program not show a output on the screen

Leave a Reply

Your email address will not be published. Required fields are marked *