Friday, December 28, 2012

Basic Structure of C Program

Basic Structure of C Program : Sample Structure to Start with C Language

Following are the suggested structure for C Language.

1. Documentation
2. Pre-processor Directive
3. Global Declaration
4. Main Function
    4.1 Local Declaration
    4.2 Program Statements
5. User Defined Functions

C Language Structure Explained with Hello World Example
//===========================================
// Program Title : C Language Structure Explained with Hello World Example
// Program Description : This is sample C Program to show the basic structure for writing C Program.
// Written Date : 28-Dec-2012
// Author :Latest Technology Guide
//===========================================

#include <stdio.h> 
#include <conio.h>

int count;

void main()
{
    int i;
    clrscr();
    print_function();
    getch();
}
void print_function()
{
   printf("Hello....");
}



Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

No comments:

Post a Comment