Free Hosting

Free Web Hosting with PHP, MySQL, Apache, FTP and more.
Get your Free SubDOMAIN you.6te.net or you.eu5.org or...
Create your account NOW at http://www.freewebhostingarea.com.

Cheap Domains

Cheap Domains
starting at $2.99/year

check

Welcome to the Frontpage

C language Tutorial

Attention: open in a new window. PDFPrintE-mail

Last Updated on Thursday, 11 April 2013 05:35 Written by atif faridi Thursday, 04 April 2013 09:06

à Computer

Computer is a set of electronics devices, electrical devices, electromechanical devices, system software’s and application software’s etc.

Example: Electronics devices: Microprocessor, Motherboard etc.

Electrical devices: SMPS, Monitor, Speaker etc.

Electromechanical devices: Keyboard, Mouse etc.

System software’s: Operating System, Device Driver etc.

Application software’s: Word Editor, Audio/ Video Player etc.

à Language

Language is a way of communication using which we give and take instructions.

Example: Hindi, English, Urdu etc.

à C Language

C is a computer language using which we give instructions to the computer.

C language is developed by Dennis Richie at AT&T Bell Laboratory New Jersy U.S.A. by restoring features of Basic Combined Programming Language (BCPL) and B language in 1972.

In 1980 it is recognized by American National Standard Institute (ANSI).

à How C language works?

C language is implemented using compiler software which provides us Integrated Development Environment (IDE) for typing C instructions, compiling and linking facilities.

Actually the instructions written in C language is understandable by programmer but not by machine. The C compiler translates C instructions into machine understandable language.

Some C compilers are:

Turbo C/ C++, Borland C/ C++, Visual C++ for Windows OS

CC, gcc, gnu, g++ for UNIX OS

à Features of C Language

1. Modularity

Structured Programming Language

C language supports to write set of instructions/ statements in four types of controlling statements.

I. Sequential Control Statement

Instructions are executed one by one.

II. Conditional or Selection Control Statement

Instructions are executed according to condition. C language provides if-else statement for this purpose.

III. Case or Choice Control Statement

Instructions are executed according to choice. C language provides switch-case statement for this purpose.

IV. Loop or Iterative Control Statement

Instructions are executed repeatedly according to condition. C language provides do-while,

while, for statement for this purpose.

1. Modularity

Dividing a program into a number of smaller sub programs is called modularity.

The C program can be divided into number of smaller sub programs called function.

2. Reusability

Once the function has been defined then the function can be used by other function as many times as required.

This feature is called reusability.

3. Portability

Source code of the program written on a C compiler can be exported to another compiler with little bit modification.

4. Supports Wide Range of Character Set

Alphabet: A to Z, a to z

Digits: 0 to 9

Special Character: ~ ` ! @ # $ % ^ & * ( ) _ - + = | \ { } [ ] : ; ? / > . < ,

5. Limited no of Keywords

As per ANSI C language has only 32 built-in keywords, so it is easy to remember to use.

ANSI Keywords

Auto

Break

Case

char

const

continue

default

Do

Double

Else

Enum

extern

float

for

goto

If

Int

Long

register

return

short

Signed

sizeof

Static

Struct

Switch

typedef

union

unsigned

Void

volatile

While

à Data Type

The type of data identification or recognition provide by programmer is called data type.

C language supports various data types and are categorized as