Piece of Information - Structure of a Simple C program
Main | Registration | Login | RSSSaturday, 2016-12-10, 11:21 PM

PiEcE oF InFoRmAtIoNs

Site menu
Search
Statistics

Total online: 1
Guests: 1
Users: 0

Structure of a Simple C program

<#include directive>
<#define directive>
main()
{
       <variable declaration section>
       Statements
       …
}

A. #include directive – "contains information needed by the program to ensure the correct operation of Turbo C’s standard library functions”
Example: #include <stdio.h>

B. #define directive – "used to shorten the keywords in the program”
Example: #define g gotoxy

C. Variable declaration section – "it is the place where you declare your variable”

D. Body of the program – " start by typing main() and the { and } (open and close braces). All statements should be written inside the { and } braces”


NOTE: Turbo C is a case sensitive program, therefore use lowercase letters only.


Commonly used include files in C language

1. alloc.h – declares memory management functions

2. conio.h – declares various functions used in calling IBM-PC ROM BIOS

3. ctype.h – contains information used by the classification and character conversion macros.

4. math.h – declares prototype for the math functions.

5. stdio.h – defines types and macros needed for standard I/O.

6. string.h – declares several string manipulation and memory manipulation routines.

Login form
Calendar
«  December 2016  »
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
25262728293031
Site friends
CLICK BELOW THE SITE YOU WANT TO GO:

Create your own site

YAHOO Mail

FACEBOOK

GOOGLE

FRIENDSTER

Our poll
Rate my site
Total of answers: 25

Copyright MyCorp © 2016
Make a free website with uCoz