c program General structure(syntax)

Pre processor directives 
(#include<stdio.h>)
Global Variable Declarations; 
(int a,float price,char x,..)
void main(){
  Local Variable Declarations; 
  (int a,float price,char x,..)
  Input/Output Statements;
}

Simple Example

#include<stdio.h>
#include<conio.h>
void main(){
    int a=10;
    float price=12.5;
    char ch='Y';
    printf("This is a C program\n");
    printf("Hello World\n");
}

output:

This is a C program

Hello World

What does "Preprocessor directives"

c language ஒரு complier based language. ஆகையால்

Preprocessor directives are the instructions given to the compiler.

They are not translated into machine language, but are operated upon directly by the compiler before the compiling process begins.

Preprocessor directives begin with a # (hash)

Preprocessor directives are often placed in the beginning of a program before the main() is declared.

Header File

அதிகபடியான library functions சிறு சிறு groups-களாக பிரிக்கபடுகிறது. இதுவே Header files என்று அழைக்கபடுகிறது.

General Syntax :

#include<header_filename.h>

Example

#include<stdio.h>
#include<conio.h>
  • stdio- Standard Input/Output
  • conio- Console Input/Output
  • void- Keyword. It Means Returns Nothing.
  • main()- இது ஒரு function name ஆகும். அதுமட்டுமல்லாமல் which can be used to indicate the beginning of the program execution

Comments