Every programming language has its own syntax for writing programs and C language is the mother language of all other languages which are developed after C language. Most of the time, I see and feel that writing a program is depends on your logical skills but other factor of knowing programming syntax can not be ignored. So I decided to write something about the syntax of C Language step by step. Just have a look to understand the syntax.
Almost all programming languages use same type of syntax i.e. starting part, declaration part, logical or conditional part, main part, modules part and closing part. Give a close look on the syntax of the C Language Program. First I am writing component being used for programming.
Components of C Program
//comments - wherever it is required
//header files - at lease one required
//main function - at least one is required
//start curly brace - immediate after main function
//variable declaration - required as per program
//function for display - required for display
//function for data input - required for input data
//logical or conditional loops - wherever required
//function for output - required for output data
//end curly brace - at the end of program
Syntax of C Program
#include<stdio.h> /*standard input-output header file */
int main() /*main function of the program*/
{ /*start of curly brace required*/
int a; /*variable declarations if required*/
printf("Any Message"); /*function to display message*/
scanf("%d",&a); /*if required to input value*/
} /*close curly brace required*/
If you memorize this simple syntax of C Program, I am sure learning C language will be very easy for you all. Do you have any question or suggestion, if yes, let me know and I will definitely give reply within 48 hours.