OVERVIEW OF C LANGUAGE
History of C Language
.B was developed in the year 1970 by Ken Thompson. The said language is a successor of Basic Command Programming Language (BCPL), which was developed by Martin Richards.
.To augment B’s power, Dennis Ritchie invented and first implemented the C Programming Language in Bell Laboratory.
.C was originally developed under UNIX environment running in DEC PDP-11.
.C stands for Combined Programming Language and sometimes called System Programming Language (SPL).
.It did not become immediately popular after its creation. It took almost six years when many people read and learned the usefulness of the language after Brian Kernighan and Dennis Ritchie created a famous book called “THE C PROGRAMMING LANGUAGE”.
.X3J11 committee was created in the year 1983 under the American National Standard Institute (ANSI) to provide machine definition of the language and was than approved in 1989.
.ANSI cooperated with the International Standard Organization (ISO) to refer to as ANSI/ISO 9899:1990”.
.C is often called a middle-level language. C as a middle-level language means that it combines elements of high-level language with the functionalism of assembly language. It allows manipulation of bits, bytes, and addresses the basic elements with which the computer functions.
.Input commands, output commands, and special words often referred to as reserved words allow the use of lower case only.
.They should be written in lower case since C is sensitive to those words. They have only 32 keywords (27 from Kernighan and Ritchie standard and 5 added by the ANSI Standardization Committee.
.C was initially used for system development work, in particular the programs that make up the operating system.
.C is used mainly because it produces codes that run as fast as codes written in assembly language.
Some Examples Uses of C
.Operating system
.Language compilers
.Assemblers
.Text editors
.Print spoolers
.Network devices
.Modern programs
.Databases
.Language Interpreters
.Utilities
Features of C Languages
-A simple core language, such as math functions or file handling provided by a standard set of library routines.
-Focus on procedural programming paradigm which facilitates for programming in a structured style.
-Parameters are always passed by value, never by reference.
-C encourages the creation of libraries user-defined functions.
-C is flexible when it allows unrestricted conversion of data from one type to another, such as conversion of a character to its numeric equivalent.
FLOWCHARTING AND ALGORITHMS
Flowcharting Defined
-Use of symbols and phrases to designate the logic of how a problem is solved.
-A common method for defining the logical steps of flow within a program by using a series of symbols to identify the basic input, process and output function within a program.
-A two-dimensional representation of an algorithm; the predefined graphic symbols of a flowchart are used to indicates the various operations and the flow of control .
-A diagram representing the logical sequence in which a combination of steps is to be performed. It is a blueprint of the program.
Algorithm Defined
-Algorithm is a finite set of instructions that specify a sequence of operations to be carried out in order to solve a specific problem or class of problems.
Basic Symbols Used in Flowcharting
Terminal (shape: rectangle with soft curves)
-Used to signify the beginning and end of flowchart.
Preparation/Initialization (shape: hexagon)
-Used to select initial conditions.
-Used to represent instructions or groups of instructions that will alter or modify a program’s course of execution.
Input/ Output (shape: parallelogram)
Processing
Decision (shape: diamond)
On-page Connector (shape: circle)
-A non-processing symbol used to connect one part of a flowchart to another without drawing flow lines.
-Conserves space by keeping related blocks near one another, reduces the number of flow lines in complex programs, and eliminates cross lines from taking place.
Off-page Connector (shape: inverted pentagon)
Flowlines (arrows)
-Signifies the process that is to be executed next.
Basic Control Structures
-Sequence
-Selection (if-then-else)
-Repetition (Looping)
Sequence
A process executed from one to another in a straightforward manner.
Selection (if – then – else)
A choice is provided between alternatives.
Repetition (Looping)
This structure provides for the repetitive execution of an operation or routine while the condition is true. The condition is evaluated before executing any process statement. As long as the condition is true, the process is executed, otherwise, control flows out of the structure.
Commonly Used Operators in Flowcharting
Arithmetic Operators
+ Addition
- Subtraction
* Multiplication
/ Division
Relational Operators
= equal
> Greater than
< less than
<> Not equal
> Greater than or equal to
< less than or equal to
Logical operators
&& AND
ll OR
! NOT
- - - - - - - - - - - - E N D - - - - - - - - - - - -