You are on page 1of 3

Programming 1

Prelims (C Basic Commands)

Four Parts of C Environment


1. Main Menu
2. Editor status line and edit window
4. “Hot Key” quick reference line

Basic Menus of C
1. File – used to load and save files, handle directories, invoke DOS and exits Turbo C.
2. Run – is used to compile, links, and runs the program currently loaded in the
environment
3. Compile – used to compile the program currently in the environment

Submenus under File menu


1. Load – enables the user to select a file to be opened or loaded into the editor.
2. Pick – enables the user to select a file based on the last nine files previously opened
or edited.
3. New – lets the user edit a new file or start new programs.
4. Save – stores or saves the file currently in the editor.
5. Write to – enables the user to save a file using a different filename
6. Directory – displays the content of the current working directory
7. Change dir – enables the user to specify the defined path to change the default path
or directory
8. OS Shell – loads the DOS command processor and lets the user execute DOS
Commands
9. Quit – lets the user to exit or quit Turbo C

Data Types – there are five elementary data types in Turbo C. They are:
Type Bidwidth Range
char 8 0 to 255
int 16 -32768 to 32767
float 32 3.4E-38 to 3.4E+38
double 64 1.7E-308 to 1.7E+308
void 0 valueless

Modifiers – is used to alter the meaning of the base type to fit the needs of various
situations more precisely.

signed
unsigned
long
short

Type Modifiers
char unsigned char signed char int unsigned int
signed int short int unsigned short int signed short int long int
float double long double
Keywords – are reserved words that have a special meaning. Reserved words are
words “reserved” by the programming language for expressing various statements and
constructs.

List of 32 Keywords defined by the ANSI standard


auto double int struct break case else
long switch case enum register typedef char
extern return union const float short unsigned
continue for short unsigned continue for signed
void default goto sizeof volatile do if
static while

Identifiers – are composed of a sequence of letters, digits, and the special


character(underscore).

Variables – are identifiers that can store a changeable value.

Kinds of Variables

Local Variables – are declared inside a function. It can only be referenced by


statements that are inside the block in which the variables are declared.

Global Variables – are known throughout the entire program and may be used by any
piece of code.

Constants – They are identifiers or variables that can store a value that cannot be
changed during the program execution.

Operator – is a symbol that tells the compiler to perform specific mathematical or


logical manipulations.

Three Class of Operators in Turbo C

1. Arithmetic Operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus Divisor
-- Decrement a Value
++ Increment a Value

2. Relational Operators
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
== Equal
!= Not Equal

3. Logical Operators
&& AND
|| OR
! NOT

Expression – refers to anything that evaluates to a numeric value

#include directive – contains information needed by the program to ensure the


correct operation of Turbo C’s standard library functions.

#define directive – used to shorten the keywords in the program.

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
7. iostream – provides functionality to use an abstraction called streams specially
designed to perform input and output operations on sequences of character, like files or
strings

You might also like