“C” seems a strange name for a programming language. But this strange name sounding language is one of the most popular computer languages today because it is a structured, high level, machine-independent language. It allows the software developer to develop programs without worrying about the hardware platform where they will be implemented.
The root of all modern language is ALGOL introduced in the early 19160. ALGOL was the first computer language to use a block structure although it never becomes popular in the USA.
It was widely used in Europe ALGOL gave the concept of structured programming to the computer science community computer scientist like Corrado Bohan does a popularized this concept during 1960.
When we write a program in C, It’s efficient and fast. This is due to its variety of data types and powerful operators. It is many time faster than BASIC, for example, a program to increase a variable from 0 to 15000 takes about 1 second in C. While it takes more than 50 seconds in an interpreter BASIC.
C language provides many types of tokens. In this passage of text, individual words and punctuation marks are called Tokens. Similarly, C program is the program the smallest individual units are known as C tokens.
There are 6 types of C tokens. C programs are written using these tokens Anderson test of the language.
Types of C tokens are below:
- Special symbols
The characters that can be used to form words, numbers and expressions depend upon that computer on which the program is run. However, it is a subset of characters that can be used on most personal MicroMini and Mainframe computers.
The characters in C are grouped into the following categories:
- Special Characters
- White Spaces
Constants in C refer to a fixed value that do not change during the execution of a program.
There are two types of Constants:
- Numeric Constants
- Integer constants
- Real constants
- Character Constants
- Single Character Constants
- String Constants
A variable is a data name that may be used to store a data value only constant that remains unchanged during the execution of a program. A variable may take different values at different times during execution. We used several variables to store the value of money at the end of each year.
A variable name can be chosen by the programmer in a meaningful way so as to replace function or nature in the program. Some example of some names is here height, Total, weight, amount etc.
Data types in “C” language is rich in its data type. Storage representation and machine instruction to handle constant differ from machine to machine. The variety of data types available allow the programmer to select the type approach appropriate to the needs of the application as well as the machine.
ANSI supports 3 Classes of Data Types:
- Primary data types
- Derived data types
- User-defined data types
C supports a rich set of built-in operators. We have already used several of them such as equal to(=), add(+), Minus(-), multiplication(*), and division(/) operator is a symbol that tells the computer to perform certain mathematics or logical manipulation.
Operators are used in a program to manipulate data and variables. They usually form a part of mathematical or logical expression. Below is the list of Operators:
- Arithmetic Operator
- Relation Operator
- Logical Operator
- Assignment Operator
- increment and decrements Operator
- Conditional Operator
- Bitwise Operator
The C program is a set of statements which are normally executed sequentially in the order in which they appear. This happens when no option or no repetition for certain calculation is necessary.
However, in practice, we have a number of situation where we may have to change the order of execution of statement based on a certain condition or repeat a group of statement and till certain specified condition.
In looping, a sequence of the statement is executed until some conditional for termination of the loop are satisfied. A program loop, therefore, consists of two segments. The control statement tests a certain condition and then direct the repeated execution of the statements contained in the body of the loop.
In many applications, we need to handle a large volume of data in terms of reading, processing and printing. To process such a large amount of data, we need a powerful data type that would facilitate efficient sorting accessing and manipulation of data items.
C supports a derived data type known as an array.
An array is a fixed size sequenced collection of elements of the same data. In other words, we can say “A collection of the same data type in a large value called Array”.
C support a rich set of derived and user define data type:
- fundamental data types
- Derived data types
- user-defined data types
A string is a sequence of characters that are treated as a single data item. Any group of character (except double quote sign) defined between double quotation marks is a string constant as like ” Joseph is always right ”.