1 / 9

STRUCTURE OF A SIMPLE C PROGRAM

STRUCTURE OF A SIMPLE C PROGRAM. <#include directive> <#define directive> Main() { <variable declaration section> statements … }.

alexis
Télécharger la présentation

STRUCTURE OF A SIMPLE C PROGRAM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. STRUCTURE OF A SIMPLE C PROGRAM <#include directive> <#define directive> Main() { <variable declaration section> statements … }

  2. #include directive- “contains information needed by the program to ensure the correct operation of Turbo C’s standard library functions”(LIM02)Example: #include <stdio.h>

  3. #define directive- “used to shorten the keywords in the program”Example: #define g gotoxy

  4. Variable declaration- “It is the place where you declare your variables

  5. Body of the program- “start by typing main() and the { and } braces” Note:“Turbo C is a case sensitive program, therefore use lowercase letters only.”

  6. Commonly used include files in C language (SARR97)1. alloc.h-declares memory management functions.2. conio.h-declares various functions used in calling IBM-PC 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.

  7. Important Symbols(SARR97)\n -is a line char used to move the cursor to the next line.‘o’ -single quote is used for single character / letter.“o” -double quote is used for two or more characters.{ -open curly brace signifies begin.} -close curly brace signifies end.& -address of operator. -indirection operator / pointer.

  8. Variable DeclarationType variable list:Example: int I, j, k;short I, j, k;2 kinds of variablelocale.i. #include<stdio.h>main () {int a, b, c

  9. global e.g. #include<stdio.h>int a, b, c;main (){

More Related