Pages

Fundamentals of C Language Tutorial#1

Monday 22 April 2013


History of C Language
C is a general perpus programing language. It is evolved from two previous languages B and BCPL. In 1972 Dennis Ritchie at Bell Labs writes C and in 1978 the publication of The C Programming Language by Kernighan & Ritchie caused a revolution in the computing world. In 1983, the American National Standards Institute (ANSI) established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard, or "ANSI C", was completed late 1988.
Why C Still Useful?
1:.C provides:


  • Flexibility and power
  • many high-level and low-level operations à middle level
  • Efficiency, high performance and high quality s/ws.
  • Stability and small size code
  • Provide functionality through rich set of function libraries
  • Gateway for other professional languages like C à C++ à Java.

2:.C is used:
  • System software Compilers, Editors, embedded systems
  • data compression, graphics and computational geometry, utility programs
  • databases, operating systems, device drivers, system level routines
  • there are zillions of lines of C legacy code
  • Also used in application programs

Development With C
Four stages
§Editing: Writing the source code by using some IDE or editor
§Preprocessing or libraries: Already available routines   
§compilingtranslates or converts source to object code for a specific platform     source code -> object code
§linking:    resolves external references and produces the executable module


Features of C language
HardWare Independent: It means that we can create applications/programs without knowng about hardware/processor.
Portable Programing: It means a program which we make can be run at everycomputer. A program written in low level language cannot be run in any computer.
High Level Language: C is a High level language. High level languagea are those languages which are near to human language but far tomachine language. Some other examples of high level languages are given: C++, Java, Cobol, LISP, Perl etc.
Case Senstive: C language is case senstive (e,g print is different from PRINT).
Builtin Functions: C language provides many builtin function. (Function that are provided by language developer is called builtin functions).

Different steps to make a simple program in c language
Edit: Write program in editor in a specific language.
Pre-processor: pre-processor directeries has builtin functions.
Compile: Convert source program into machine lannguage.
Link: Link other files to the programs(e,g header files).
Load: Load programs in the memory RAM.
Execute: Run Program. Execute program.

Some Editor for C language 
  1. Turbo C
  2. Mocrosoft C
  3. Dev CPP
  4. Boreland
  5. Cfree

A Simple Program in C

 #include <stdio.h>
void main()
{
           printf("Hello World!");
}

Different parts of this program:
#include <stdio.h> This is method to include header file in our program. Here we include stdio.h header file which contain function like printf, scanf and others.
void main() is a function which is used to start our program. Execution of program is always start through main. and Void is data type of function main. We learn about data types in next tutorials.
start body of main function.
printf("Hello World!"); It is statement that prints Hello World! on the screan we can write any thing in (" ") that is print on the screan as it is.
end of main body.

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *