Programming in C Language.

C "Hello World" Program

In this example, you will learn to print "Hello World" on the screen in C programming.

/********************************************************
  
  /****** C Language Programmes ******/
  Programmer = VINIT
  Programm   = Write a programm to print Hello World.
  Notice     = If you have any doubts then type in comment box

*********************************************************/


Hello World Programm

Now we are going to explain this Programm.

#include <stdio.h> & #include <conio.h>  = Header files , it is compulsory to make programms.
void main()    = Function.
Symbol ( ; )   = This symbol is known as Terminate & it is use close the program in line.
Symbol ( { and } )   = It use to tell the starting & ending point of the programm.
printf("  ");  = It is use to print the text on the screen.
getch();  = It is compulsory to type at the end of programms because it is use to hold the screen at the output.
/**   **/   = It is use to give comments in programm.

Header Files

header file is a file with extension . h which contains C function declarations and macro definitions to be shared between several source files. There are two types of header files: the files that the programmer writes and the files that comes with your compiler.

void main() Function

The void main() indicates that the main() function will not return any value, but the int main() indicates that the main() can return integer type data. When our program is simple, and it is not going to terminate before reaching the last line of the code, or the code is error free, then we can use the void main().

getch() Function

Getch() function is need to be used in some c compilers like turbo cGetch is used to hold the output sceen and wait until user gives any type of input(i.e. Until user press any key ) so that they can read the character and due to this we able to see the output on the screen.

Comment

comment starts with a slash asterisk /* and ends with a asterisk slash */ and can be anywhere in your program. Comments can span several lines within your C program. Comments are typically added directly above the related C source code.

Printf Function

Printf format string refers to a control parameter used by a class of functions in the input/output libraries of C and many other programming languages. 

Output of the Programm

Output of Programm


एक टिप्पणी भेजें

0 टिप्पणियाँ