C Programming

INTRODUCTION TO C

C is a

1. It is a high level / middle level programming language.

2. C is a compiler based programming language.

3. C is a procedure oriented programming language [ POP’s]

What is a program?

Set of instructions is called program What is a software?

Set of programs is called software. As per IT industry software is a digitalized and automated process.

Basically software divided into 2 types.

1. System software

Eg: O.S, device drivers, Translators

2. Application software

Eg: calculator, calendar, vlc media player,…

What is a language?

Generally the languages like Telugu, English, hindi, Marathi etc are used to communicate with the human beings. Hence they are called human languages. The languages like C / C++ / Java / .Net / Python / Go / R languages etc are used to develop the programs [ software ] to communicate with the machines.

Basically the languages divided into 3 types.

1. Machine language: Created with binary code. Eg: 11000111

2. Low level / Assembly languages: Created with English like shortcuts called MNEMONICS.

Eg: add, sub,…

3. High level language: Created with simple English and easy to understand.

Eg: addition, subtract,….

C is a high level language with low level features. Hence it is also called middle level language.

C low level features used to design system software and high level features used to design application software. Hence c is also called it is a multipurpose programming language.

What is a translator?

Basically the programmer given instructions are in English, which is called source code or source program. But the machines are not able to understand this English code. To convert this source code to binary code we are using the interface software, which is called translator like

1. Compiler

2. Interpreter

3. Assembler

Compiler and interpreter both are used to convert high level languages to binary code.

Compiler converts the total program into machine language at once, by leaving error lines.

Interpreter converts line by line.

Assembler is used to convert low level programs to binary code. Assembler working style is similar to the compiler.

In C & C++ we are using compiler as a translator. Hence they are called compiler based programming languages.

In java / .net / python we are using compiler and interpreter. Hence they are called compiler based interpreted languages.

What is a programming paradigm?

Every programming language comes with particular structure with rules and regulations, which is technically called programming paradigm.

What is called monolithic programming paradigm?

Before C languages, the languages are using monolithic programming structure. In this the entire program they are designing with single program. Due to this it is very difficult to find the errors and there is no reusability. To avoid the problems in monolithic programming they have introduced the procedure oriented programming structure. In this a big program is divided into several small sub programs / sub routines / procedures / functions / modules / structures. Hence c program is collection of procedures, it is called procedure oriented programming structure [ POP’s]

Advantages:

1. Modularity: Dividing big program into several small pieces according to the project requirement.

2. Simplicity: Easy to read / understand.

3. Reusability: write once, use many times.

4. Efficiency: Performance is high.

Function oriented programming structure:

C follows procedure oriented programming structure.

C++ & Python uses POP’s and OOP’s. hence they are called multi paradigm programming languages. Java / .Net follows only the OOP’s

Disadvantages:

In POP’s the data is public.

Object Oriented Programming Structure: