0% found this document useful (0 votes)
53 views28 pages

Microsoft PowerPoint - C Language

C programming language was developed in 1972 by Dennis Ritchie at Bell Labs. It was created to write the UNIX operating system and is widely used today for systems programming. C is a middle-level language as it has features of both low-level and high-level languages, providing more control and efficiency than high-level languages while being more portable and readable than low-level assembly languages. C's popularity is due to it being simple, portable, structured, and having a rich standard library with support for memory management, pointers, and recursion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views28 pages

Microsoft PowerPoint - C Language

C programming language was developed in 1972 by Dennis Ritchie at Bell Labs. It was created to write the UNIX operating system and is widely used today for systems programming. C is a middle-level language as it has features of both low-level and high-level languages, providing more control and efficiency than high-level languages while being more portable and readable than low-level assembly languages. C's popularity is due to it being simple, portable, structured, and having a rich standard library with support for memory management, pointers, and recursion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

C- Programming Language

 Overview of C Language: History of C, Character set,


C tokens, Identifiers, Keywords,Data types, Variables,
Constants, Symbolic Constants , Operators in C,
Hierarchy ofOperators, Expressions, Type
Conversions and Library Functions.
 Managing Input and Output Operation: Formatted
and Unformatted I/O Functions,Decision making,
branching and looping: Decision Making Statements -
if Statement, if–else statement, nesting of if-else
statements, else–if ladder, switch statement,?:
operator
 Looping - while, do-while, for loop, Nested loop,
break, continue, and goto statements.Functions:
Function Definition, prototyping, types of functions,
passing arguments tofunctions, Nested Functions,
Recursive functions.
 Arrays: Declaring and Initializing, One Dimensional
Arrays, Two Dimensional Arrays,Multi-Dimensional
Arrays - Passing arrays to functions. Strings:
Declaring andInitializing strings, Operations on
strings, Arrays of strings, passing strings to
functions.Storage Classes - Automatic, External,
Static and Register Variables
 Structures-Declaring and Initializing, Nested
structure, Array of Structure, PassingStructures to
functions, Unions, typedef, enum, Bit fields. Pointers
– Declarations,Pointer arithmetic, Pointers and
functions, Call by value, Call by reference, Pointers
andArrays, Arrays of Pointers, Pointers and
Structures. Meaning of static and dynamicmemory
allocation, Memory allocation functions.
 Language is the medium of communication to
share ideas, opinions with each other.
 For example, if we want to communicate with
someone, we need a language that can be
any of the languages that both the
communicators know it can be English, Hindi,
Spanish, or another language.
 But you need at least one language to
communicate with someone (human/person).
 To communicate with a person, you need a
language.
 In the same way, if you need to communicate
with the computer, you need a programming
language.
 Without a programming language, you cannot
communicate with the computer.
 The programming language is the medium of
communication between human and
computer systems.
 It is the set of instructions written in a
specific style (coding) to instruct the
computer to perform a specific task.
 A programming language is a vocabulary and
set of grammatical rules for instructing
computer or computing device to perform
specific tasks.

 The term programming language usually refers


to high-level languages, such
as BASIC, C, C++, COBOL, Java, FORTRAN, Ada,
and Pascal.

 Each programming language has a unique set


of keywords (words that have specific meaning)
and a special syntax for organizing
program instructions.
There are three types of computer programming
languages, they are:

 Low-level programming languages


 High-level programming languages
 Middle-level programming languages
 These are machine-dependent programming
languages.
1. Binary (Machine code)
2. Assembly language

 Computers can only understand Binary


language which is instructions in the form of
0's and 1's.

 So computer can easily understand the binary


language, but it is not user friendly.
 Sometimes referred to as Machine
code or Object code, or Binary Language.

 Machine language is a collection of binary digits


or bits (i.e. 0 and 1), that the computer reads
and interprets. Computer can only understand
Binary language.

 Example:- Below is an example of machine


language (binary) for the text Hello.
01001000 01100101 01101100 01101100
01101111
 It is a language closer to what machines can
understand.
 Assembly language is an example of low level
language.
 A short-code (mnemonics) is written for each
instruction in assembly language
programming.
 So, instead of having to remember a string of
0’s and 1’s, the programmer would only need
to remember short-codes like ADD, SUB, DIV,
JMP, MOV called mnemonics.
 Assembly language is also processor dependent
 Computer can not understand assembly
language directly, so we need a translator.
 An Assembler is a translator that translates the
assembly language code (source code) into
Machine language code/ Binary language code
(Object code).

Assembly Language Binary Language


Code (Source code) code (Object code)
 These are the machine-independent
programming languages, also these
languages are user friendly means easy to
write, read, edit, and understand.

Examples: -
 Java, .Net, Python, JavaScript, C++, C, C# etc.
 The computer does not understand the
program written in high level languages
directly, because the computer can
understands only Machine code (Binary
language).

 So, Programming language translators


are required to convert a high-level
program to its equivalent Machine code.

 Programming language translators are:


1. Compilers
2. Interpreters.
 Compiler is a translator software that translates
the source code written in high level language
into object code written into low level language.
It has the property that it can translates the
complete code at once.

Compiler

Source code object code


(HLL code) (LLL code)
 Interpreter is a translator software that
translates the source code written in high level
language into object code written into low level
language. It has the property that it can
translates the code line by line.

Interpreter

Source code object code


(HLL code) (LLL code)
 Portable (system-independent): The
programs written in High-Level programming
languages are independent of the system
which means a program written on one
system can run on another system.

 Easy to understand: Code written in High


level programming languages is just like the
English language so we can easily understand
the meaning of a particular term in that
programming language.
 Easy to code, read, and edit: The programs
written in a high-level programming
language are easy to code, read, and edit.
Even we can edit programs written by other
programmers.
 There is no such category of programming
languages.

 Hence, we can say that the programming


languages which have features of Low Level
as well as High-Level programming
languages known as "Middle Level"
programming language.

 C programming languages is the best


example of Middle-Level Programming
languages as it has features of low level and
high-level programming languages both.
 C programming language was developed in 1972.
 It was developed by Dennis Ritchie. (Dennis
Ritchie is known as the founder of the c language.)
 It was Developed at AT&T bell laboratories
(American Telephone & Telegraph), U.S.A.
 It was developed to overcome the problems of
previous languages such as B, BCPL, etc.
 Initially, C language was developed to design UNIX
operating system.
 C was invented to write an operating
system called UNIX. The UNIX OS was
totally written in C.
 Linux OS and RDBMS, MySQL have been
written in C.
 C is a successor of B language.
 The language was formalized in 1988 by
the American National Standard Institute
(ANSI).
 Today C is the most widely used and
popular System Programming Language.
1) Simple:- C is a simple programming
language, which means a user can easily
understand the code written in this
language.

2) Machine Independent or Portable:- C


language is machine independent which
means there is no need to write different
codes for different machines, you can write
a program for a machine and can also run
that on another machine.
Mid-level programming language:-
 C programming languages is the best
example of Middle-Level Programming
languages as it has features of low
level and high-level programming
languages both.
 It is used to develop system
applications such as kernel, driver, etc.
4) Structured programming language:- C
is a structured programming language in
the sense that we can break the program
into parts using functions. So, it is easy
to understand and modify.

5) Rich Library:- C provides a lot of inbuilt


functions that make the development
fast.

6) Memory Management:- It supports the


feature of dynamic memory allocation. In
C language, we can free the allocated
memory at any time.
7) Speed:- The compilation and execution time of
C language is fast since there are lesser inbuilt
functions and hence the lesser overhead.

8) Pointer:- C provides the feature of pointers. We


can directly interact with the memory by using
the pointers. We can use pointers for memory,
structures, functions, array, etc.

9) Recursion:- In C, we can call the function within


the function. It provides code reusability for
every function. Recursion enables us to use the
approach of backtracking.

10) Extensible:- C language is extensible because


it can easily adopt new features.

You might also like