L-14.3 Computer Languages
L-14.3 Computer Languages
▪ Machine language
▪ Assembly language
▪ High-level language
Machine Language
Limitations
▪ Machine Dependent
▪ Difficult to program
▪ Error prone
▪ Difficult to modify
Assembly/Symbolic
Language
Programming language that overcomes the limitations of machine
language programming by:
▪ Machine dependent
▪ Knowledge of hardware required
▪ Machine level coding
High-Level Languages
▪ Machine independent
▪ Do not require programmers to know anything about the
internal structure of computer on which high-level language
programs will be executed
▪ Deal with high-level coding, enabling the programmers to
write instructions using English words and familiar
mathematical symbols and expressions
Advantages of High-Level
Languages
▪ Machine independent
▪ Easier to learn and use
▪ Fewer errors during program development
▪ Lower program preparation cost
▪ Better documentation
▪ Easier to maintain
Limitations of High-Level
Languages
▪ Lower execution efficiency
▪ Less flexibility to control the computer’s CPU, memory and
registers
C
c
▪ Developed in 1972 at AT&T’s Bell laboratories, USA
by Dennis Ritchie and Brian Kernighan
▪ Standardized by ANSI and ISO as C89, C90, C99
▪ High-level programming languages (mainly machine
independence) with the efficiency of an assembly
language
▪ Language of choice of programmers for portable
systems software and commercial software
packages like OS, compiler, spreadsheet, word
processor, and database management systems
C is Middle Level Language
There are following reason that C is called Middle Level
Language as:
C programming language behaves as high level language
through function, it gives a modular programming and
breakup, increased the efficiency for resolvability.
C programming language support the low level language i.e.
Assembly Language.
C language also gives the facility to access memory through
pointer.
Its combines the elements of high-level languages with the
functionalism of assembly language.
What is Variable
Naming Variables
Declaring Variables
Using Variables
x=a+b
z + 2 = 3(y – 5)
Note:
C language is case sensitive. For example, printf() and scanf()
are different from Printf() and Scanf(). All characters in printf()
and scanf() functions must be in lower case.
scanf() function
scanf() function:
The scanf function allows you to accept input from
standard in, which for us is generally the keyboard.
scanf() function is used to read character, string,
numeric data from keyboard
Consider below example program where user enters
a character. This value is assigned to the variable
“ch” and then displayed.
Then, user enters a string and this value is assigned to
the variable ”str” and then displayed.
Thank You