Posts

Showing posts with the label structure

Structure of C-Language

Image
Now let us combine all the above three sections/parts to make a complete C program. =>/* Program to print hello world*/ #include<stdio.h>     /*link section*/ Int main()                   /*main function*/ {       Printf(“Hello world”);       Return 0; } Output: -  Hello world Note: - only link and main function sections are compulsory. Documentation section is optional. The various sections/parts of a C program are:- 1)  Document section :-  Gives the brief explanation of the program, author,date written etc….. 2)  Link section :- Include header files with #include statements. 3)  Definition section :- variables and initializes them using # define. 4)  Global declaration section :-   The  variables used throughout the program are declared. 5)    Function Protot...

Introduction Structure of C-Language

Image
  Structure of c language program:-             To write programs in c, we should follow the basic structure of the c program. Structure of a C program includes various sections/parts. All these sections may or may not be used in all the programs, But to write complete C program that can be easily understood by programmers one should use some or all the sections based on the program complexity and functionality. Simple programs may use a few sections and complex programs may use all the sections of the program structure.               To understand the concept let us begin with a sample program with only three sections. 1)  DOCUMENTATION  SECTION :- Gives the aim of the program or double line comment(This should be between '/*this comments is used  for  understand    any programs easily or find debug's easily*/').  ...