Introduction to Programming - (C Language) - Unit : 1 - INTRODUCTION TO PROGRAMMING LANGUAGES
The computer is an electronic device that
works on the instructions provided by the user. As the computer does not
understand natural language, it is required to provide the instructions in some
computer-understandable language. Such a computer-understandable language is
known as a Programming language.
A computer programming language consists of a
set of symbols and characters, words, and grammar rules that permit people to
construct instructions in a format that can be interpreted by the computer
system Computer Programming is the art of making a computer do what you want it
to do.
Programming
Language:
Different
programming languages support different styles of programming. The choice of
language used is subject to many considerations, such as company policy,
suitability to task, availability of third-party packages, or individual
preference.
The
basic instructions of programming language are:
1. Input: Get data from the keyboard, a
file, or some other device.
2. Output: Display data on the screen or
send data to a file or other device.
3. Math: Perform basic mathematical
operations like addition and multiplication.
4. Conditional execution: Check for certain conditions and
execute the appropriate sequence of statements.
5. Repetition: Perform some action repeatedly,
usually with some variation.
Types
of Programming Languages:
1. Machine Level Language: Computer language, also known as machine code, is a low-level programming
language made up of binary digits (ones and zeros).
Since computers are digital
devices, they only recognize binary data. Every program, video, image, and
character of text is represented in binary. This binary data, or machine code,
is processed as input by the CPU. The resulting output is sent to the operating
system or an application, which displays the data visually. For example, the
ASCII value for the letter "A" is 01000001 in machine code, but this
data is displayed as "A" on the screen. An image may have thousands
or even millions of binary values that determine the color of each pixel.
The program to add two numbers in
memory and print the result look something like the
Following:
001000000000001100111001
001111000000111111000111
100111100011101100110101
101100010101010101110000
000000000000000000000000
2. Assembly Language: Assembly
languages are also known as second generation languages. These languages
substitute alphabetic symbols for the binary codes of machine language. In
assembly language, symbols are used in place of absolute addresses to represent
memory locations. Mnemonics are used for
operation
code, i.e., single letters or short abbreviations that help the programmers to
understand what the code represents.
Ex:
MOV
AX, DX.
The preceding
program was written in machine language for adding two numbers and
printing out the
result could be written in the following way:
CLA A
ADD B
STA C
TYP C
3.
High-Level
Languages: High-level programming languages create computer
programs using instructions that are much easier to understand than machine or
assembly language code because you can use words that more clearly describe the
task being performed.
When writing a program in a high-level language, then the whole attention
needs to be paid to the logic of the problem. A compiler is required to
translate a high-level language into a low-level language.
High-level languages include FORTRAN, COBOL, BASIC, PASCAL, C, C++, JAVA
and Python.
Introduction to C Programming: C is a general-purpose, structured
programming language. Structured Languages have a characteristic program
structure and associated set of static scope rules. C originated in Bell
Telephone Laboratories presently known as AT&T Bell Laboratories by Dennis
Ritchie in 1972.
C has the feature of a high-level programming
language as well as low-level programming. It works as a bridging gap between
machine language and the more conventional high-level languages.
Applications of C Language
Mainly C Language is used for developing
desktop applications and system software. Some
applications of C language are given below.
o C programming language can be used
to design the system software like an operating system and Compiler.
o To develop application software
like databases and spreadsheets.
o Develop Graphical related applications
like computer and mobile games.
o To evaluate any kind of
mathematical equation use c language.
o C programming language can be used
to design the compilers.
o UNIX Kernel is completely
developed in C Language.
o For Creating Compilers of
different Languages that can take input from other languages and convert it
into lower-level machine-dependent language.
o C programming language can be used
to design an Operating System. C programming language can be used to design
Network Devices.
o To design GUI
Applications. Adobe Photoshop, one of the most popularly used photo editors since olden times, was
created with the help of C.
Comments
Post a Comment