Introduction to C Programming
± C is a general-purpose high level language
± Father of C – Dennis Ritchie
± Originally developed for the UNIX operating system
± Implemented on the Digital Equipment Corporation, PDP-11 computer in 1972
± The UNIX operating system and all UNIX applications are written in the C language
± Easy to learn
± Structured language
± It produces efficient programs
± It can handle low-level activities
± It can be compiled on a variety of computers
Why we use C?
± C was initially used for system development work, in particular 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 code written in assembly language.
± Some examples of the use of C might be:
° Operating Systems
° Language Compilers
° Assemblers
° Text Editors
° Network Drivers
° Data Bases
° Language Interpreters
° Utilities
Function of C:-
± C is a case sensitive programming language. It means in C printf and Printf will have different meanings.
± C has a free-form line structure. End of each C statement must be marked with a semicolon.
± White Spaces (i.e. tab space and space bar ) are ignored.
± Multiple statements can be one the same line.
± Statements can continue over multiple lines.
C Tokens:-
± C tokens are the basic buildings blocks in C language which are constructed together to write a C program.
± Each and every smallest individual units in a C program are known as C tokens.
C tokens are of six types. They are,
° Keywords (eg: int, while),
° Identifiers (eg: total),
° Constants (eg: 10, 20),
° Strings (eg: “total”, “hello”),
° Special symbols (eg: (), {}),
° Operators (eg: +, /,-,*)
Example :
int main()
{
int x, y, total;
x = 10, y = 20;
total = x + y;
printf ("Total = %d \n", total);
}
Character Sets:-
± The character set in C Language can be grouped into the following categories.
° Letters
° Digits
° Special Characters
° White Spaces
§ Upper Case A to Z
§ Lower Case a to z
± Digits
§ 0 to 9
± White Space
§ Blank Space
§ Horizontal Tab
§ New Line
Post A Comment:
0 comments so far,add yours