#include<stdio.h>
/*
Program to print Hello World
*/
int main()
{
     printf("Hello World");
     return 0;
}

A C program basically consist of following parts::

  • Pre-processor Commands
  • Comment
  • Functions
  • variables
  • Statements and expressions

Pre-processor Commands : First line of the program #include is a pre-processor commands.  Preprocessor directives are lines included in the code of programs preceded by a hash sign (#). Before compiling source code in a compiler,  the preprocessor examines the code before. No Semocolon(;) is expected

Comments : Single Line Comment (//) or Multi – Line Comment (/*  —   */). Comments are not mandatory for any C Program. These lines will be ignored by the compiler. Its a good practice to include comments in your programs as it improves readability also easy to understand complex or large programs.

Functions :  main function(int main() ), is a function where program execution startand ends. Every program should have main function.

Variables : Used to store temporary values.

Statements and Expression

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s