Flowcharts, Programming Languages, and the C Language
Classified in Computers
Written at on English with a size of 5.56 KB.
Understanding Flowcharts
The pictorial or graphical representation of the flow of a program is known as a flowchart. If algorithms or programs are displayed in the form of a picture, then it will be more noticeable and recognizable. We only need to know some specific shapes to represent each process or action. The fundamental shapes and descriptions used in flowcharts are as follows:
- Rhombus: For decision-making and branching the flow of execution.
- Rectangle: For processing and assigning variables.
- Parallelogram: Accessing inputs and printing outputs.
- Rectangle with Curved Edges: Start/Begin or Stop/End of the program execution.
- Circle: Connectors to continue the flow of execution.
- Arrow: Represents the direction of the flow of execution.
Programming Languages: Low-Level and High-Level
Low-Level Language: Programs or sets of instructions written in the form of binary (1s and 0s) are known as Low-Level Language or Machine Language. This is the only language that can be understood or interpreted by a computer.
High-Level Language: Programs or sets of instructions that are written in structured languages such as English are known as High-Level Languages. High-level languages are not directly interpreted or understood by a computer. Examples: C, FORTRAN, COBOL, BASIC, etc.
Introduction to the C Programming Language
C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. It was originally first implemented on the DEC PDP-11 computer in 1972.
In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard.
The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used professional language for various reasons:
- Easy to learn
- Structured language
- It produces efficient programs
- It can handle low-level activities
- It can be compiled on a variety of computer platforms
History and Popularity of C
- C was invented to write an operating system called UNIX.
- C is a successor of the B language, which was introduced around the early 1970s.
- The language was formalized in 1988 by the American National Standard Institute (ANSI).
- The UNIX OS was totally written in C.
- Today, C is the most widely used and popular System Programming Language.
- Most of the state-of-the-art software has been implemented using C.
- Today's most popular Linux OS and RDBMS MySQL have been written in C.
Uses of C
C was initially used for system development work, particularly the programs that make up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as the code written in assembly language. Some examples of the use of C are:
- Operating Systems
- Language Compilers
- Assemblers
Structure of a C Program
The documentation section consists of a set of comment lines giving the name of the program, author, and other details which the programmer would like to use later. The link section provides instructions to the compiler to link functions from the system library. The definition section defines all symbolic constants. There are some variables that are declared in the global declaration section, which is outside of all the functions.
Every C program has one main() function section. This section contains two parts: the declaration part and the executable part. The declaration part declares all variables used in the executable parts. There is at least one statement in the executable part. These two parts must appear between the opening and closing braces. The program execution begins at the opening brace and ends at the closing brace. The closing brace of the main function section is the logical end of the program. All statements in the declaration and executable parts end with a semicolon.
The subprogram section contains all the user-defined functions that are called in the main function. User-defined functions are generally placed immediately after the main function.