C - Basic Structure with Example

 Basic Structure of C Program :

Document Section

Links Section (File)

Definition Section

Global variable declaration Section

main() function definition

{

Variable declaration section

Function declaration section

executable statements;

}

Function definition 1

Function definition n

Simple C Program :

/* A simple program*/                      /*Document Section */

#include<stdio.h>                              /*Links Section (File) */

 #define pi 3.14                                   /*Definition Section */

main()                                                 /*main() fun. Definition */

{

int x=5;                                                /*Variable declaration section */

printf(“Hello student”);                     /*executable statements */

printf(“Value of a=%d”,x);

getch();

}

Comments

Popular posts from this blog

Courses After 12th Science

MS Office Versions List

Computer - Network Topologies