0% found this document useful (0 votes)
24 views8 pages

Lecture1 1

Uploaded by

Mohd Aazad
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)
24 views8 pages

Lecture1 1

Uploaded by

Mohd Aazad
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/ 8

Programming in C

Unit-1
Chapter-1 Basic Concepts of Programming Language

By- Shivani Kumawat

A programming language is a set of instructions and syntax used to create


software programs. Some of the key features of programming languages include:

1. Syntax: The specific rules and structure used to write code in a


programming language.

2. Data Types: The type of values that can be stored in a program, such as
numbers, strings, and Booleans.

3. Variables: Named memory locations that can store values.

4. Operators: Symbols used to perform operations on values, such as


addition, subtraction, and comparison.

5. Control Structures: Statements used to control the flow of a program, such


as if-else statements, loops, and function calls.

6. Libraries and Frameworks: Collections of pre-written code that can be used


to perform common tasks and speed up development.

7. Paradigms: The programming style or philosophy used in the language,


such as procedural, object-oriented, or functional.
The basic components of a computer are:

1. Input unit

2. Central Processing Unit(CPU)

3. Output unit

The CPU is further divided into three parts-

 Memory unit

 Control unit

 Arithmetic Logic unit


Hierarchy of Computer language –

1. Low Level Language: A Low-level


level computer language includes only 1’s and
0’s. This language was used in first and second generation computers. A
Low level language is very easily understood by a computer but hard
har to
understand for Humans.
Low level languages are designed to interact with computer hardware,
which are categorized into two types: Machine level language and
Assembly level language.
2. Machine Language: As discussed above, Machine level language is a type of
Low level language. Machine language is considered to be the oldest computer
language. Machine language is developed by only using binary numbers i.e., 0 and
1. So, the instructions or the statements in this language use a sequence of 0’s
and 1’s.

Example of a statement in Machine code: 101010001011

3. Assembly Language: Assembly level language in computer programming


has evolved with the advancements in the machine language. Assembly language
uses symbols, which are popularly known as mnemonics in computer terminology
to write the instructions. So, comparatively writing a program in Assembly
language is more understandable to the Human than Machine Language.

Example of mnemonics in Assembly code: LOAD r2, a; CLR, MOV, MOVL, PUSH

Processing of Assembly Language


The Assembly language code will be converted into a Machine language code with
the help of an Assembler so that the computer can understand the binary
converted Assembly Language.

4. High Level Language: High Level computer languages are the advanced
development languages in the evolution of computer languages. These languages
are designed to make the programming easier and less error-free.
error free.
High
igh level language uses words and commands along with symbols and numbers.

The keywords used in High level languages are similar to English words and can be
easily understood by Humans when compared to a Low level language.

Types of programming languages in High level languages are:


 C
 C++
 Java
 Java Script
 Python
 C#
 PHP
The above given computer languages list are a few examples but there are
many other computer languages. Each of these languages has their own
syntax (structured statements) and keywords.
Example of a statement in High level language: Printf (“Hi”);

Difference between High-Level and Low-Level Computer languages


S.
Low Level Computer Language High Level Computer Language
No
Low level languages are hard to
High level languages are simple
understand by humans as they use binary
1. to understand by humans as
numbers and easy to understand by the
they use English statements.
computer.
Low level languages are programmer- High level languages are human
2.
friendly friendly.
Program execution time (computational Program execution time is
3.
speed) is less. longer.
4. These are complex to maintain. These are simple to maintain.
Debugging process is hard. It is easy to debug in High level
5.
languages.
The programs in low level language are The programs in a high level
6. not portable from one computer to language are portable, so we
another. can use them on any computer.
Usage of low level language is less in We use high level language in
7.
today’s technologies. today’s technologies.
Low Level and High Level computer Languages

Important Terms Used in Computer Languages

 Statement: A statement is telling a computer on how to do a desired action


using words or instructions.

 Syntax: Syntax is the structured arrangement of statements.

 Algorithm: Algorithm is a set of instructions written to solve a problem. It's


the logical thought process of a computer.

 Binary numbers: Binary numbers are a way of expressing data. The


numbers 1 and 0 are called binary numbers. Computers can only
understand binary language. Computers can be able to process millions of
1’s and 0’s.

 Coding: Do you know “what is computer code”? Coding is ththe process of


creating computer instructions. Computer codes are also called Programs.
A simple C language code to print a statement is given below.

#include <stdio.h>

int main() {

printf("Hello World");

// printf() displays the string inside quotation

return 0;

 Debug: Debugging is the process of finding and removing errors from a


code.

 Assembler: An Assembler is a computer program designed in such a way


that it converts mnemonics to 0’s and 1’s.

You might also like