You are on page 1of 15

C Programming Language

What is language ?
Language is medium of communication. If two persons want to communicate with each other , they have to use a common language. Like Hindi, English, Punjabi .

What is Programming Language ?


Much in the same way when a user wants to communicate with a computer ,the language that he/she uses for this purpose is known as programming language . Like BASIC, COBOL, C, C++, JAVA At the same time we know that computer understands only one language that is MACHINE LANGUAGE. This language comprises of only 0 & 1. Its very difficult for us to learn this language. For Example two persons belonging to two different countries , want to communicate then there may be a problem of common communication medium. To solve this problem there is a requirement of translator.

Types of Programming language


Basically there are two types of Programming languages. Programming. Language

Low Level Languages

High Level Languages C

Machine Language Assembly language

C++
JAVA
:

Types of Translator

SOURCE CODE

Compiler

OBJECT CODE

SOURCE CODE

Interpreter

OBJECT CODE

SOURCE CODE

Assembler

OBJECT CODE

Basics of C

Introduction of C
C was developed by Dennis Ritchie at AT & T bell laboratory of USA in 1972.

The Beginning of C

C A Middle Level Language

C is Middle Level Language


C stands in between these two categories. Since it was designed to have both:
A relatively good programming efficiency as compared to Machine Oriented Languages . A relatively good Machine efficiency as compared to Problem Oriented Languages .

Thats WHY it is called a Middle Level Language.

Application Areas Of C
C was initially used for systems programming. A system program forms a portion of the operating system of the computer or its support utilities. Operating Systems, Interpreters, Editors, Assembly programs are usually called system programs. The UNIX operating system was developed using C. There are C compilers available for almost all types of PCs.

A simple Program of C
/* Write a program to print Hello India*/ #include<stdio.h> void main() { printf(Hello India); } //Note- Here void is return type.

 Comment about the program should be enclosed within /* & */.  printf() is a function which is used to print messages on the screen.  main() is a function from which execution of the program starts.  Here stdio.h is a library file which contains standard input/output functions , keywords etc.  #include<> is used to define the library file that is to be used in the program for compiler information.

Compilation & Execution of a Program


C Source Code C Preprocessor Expanded C Source Code C Compiler Target Assembly Code Linker Executable Code Loader Output

Execution Process of a Program


PROCESS Save Compile Execute Back up SHORT CUT F2 Alt + F9 Ctrl + F9 Again F2 FILE NAME abc.c abc.obj abc.exe abc.bak

You might also like