introduction to c programming - Topic 1.pdf

rajd20284 14 views 47 slides Jun 17, 2024
Slide 1
Slide 1 of 47
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47

About This Presentation

C programming


Slide Content

Introduction to Programming (ECS 102)
Instructors:

Dr. Jasabanta Patro and Dr. Rini Smita Thakur

Introductory Concepts

Introduction to Computers!
●You will find them in many different forms.
○Massive Servers
○Workstations, Desktops, Laptops
○Tablets/Smartphones

COMPUTER CHARACTERISTICS
●All digital computers, regardless of their size, are basically electronic devices
that can transmit, store, and manipulate information (i e., data).
○Numeric data, -> common data type
○Character data (names, addresses, etc.) -> common data type
○Graphic data (charts, drawings, photographs, etc.), and
○sound (music, speech patterns, etc.).
●To process a particular set of data, the computer must be given an
appropriate set of instructions called a program.
●These instructions are entered into the computer and then stored in a portion
of the computer’s memory.

COMPUTER CHARACTERISTICS

COMPUTER CHARACTERISTICS

Memory
●Every piece of information stored within the computer’s memory is encoded
as some unique combination of zeros and ones.
●These zeros and ones are called bits (binary digits).
●Each bit is represented by an electronic device that is, in some sense, either
“off’ (zero) or “on” (one).

Memory

Memory

Memory: Bytes and Words
●Large computers have memories that are organized into words rather than
bytes. Each word will consist of a relatively large number of bits-typically 32
or 36.

Memory: Bytes and Words

Memory: Bytes and Words

Memory: Auxiliary storage devices
●Types:
○Magnetic Tapes
○Disks (HDDs, SSDs)
○Optical memory devices (CDs, DVDs etc.)
●They can store higher amount of information (In GBs)

Speed and Reliability
●Because of its extremely high speed, a computer can carry out calculations
within minutes that might require many days, perhaps even months or years, if
carried out by hand.
○For example, the end-of-semester grades for all students in a large university can typically be
processed in just a few minutes on a large computer

●The time required to carry out simple computational tasks, such as adding
two numbers, is usually expressed in terms of microseconds or
nanoseconds.

MODES OF OPERATION
●Batch Processing
○A number of jobs are entered into the computer, stored internally, and then processed
sequentially.
●Time-sharing
○Timesharing allows many different users to use a single computer simultaneously.
●Interactive Computing
○In an interactive computing environment, the user and the computer interact with each other
during the computational session.

INTRODUCTION TO C
●C was originally developed in the 1970s by Dennis Ritchie at Bell Telephone
Laboratories, Inc. It is a general-purpose, structured programming language.

●Its instructions consist of terms that resemble algebraic expressions,
augmented by certain English keywords such as if, else, for, do and while.

●C also contains certain additional features, however, that allow it to be used at
a lower level, thus bridging the gap between machine language and the more
conventional high-level languages.

INTRODUCTION TO C
●This flexibility allows C to be used for systems programming (e.g., for writing
operating systems) as well as for applications programming (e.g., for writing
a program to solve a complicated system of mathematical equations, or for
writing a program to bill customers).

●C is characterized by the ability to write very concise source programs, due in
part to the large number of operators included within the language.

●It has a relatively small instruction set, though actual implementations include
extensive library functions which enhance the basic instructions.

Structure of a C Program
●Every C program consists of one or more modules called functions.
●One of the functions must be called ‘main’.
●The program will always begin by executing the main function, which may
access other functions.

Points to be noted.

Points to be noted.

Points to be noted.

Points to be noted.

SOME SIMPLE C PROGRAMS
●Each program calculates the area of a circle,
●Each program illustrates a somewhat different approach to this problem

DESIRABLE PROGRAM CHARACTERISTICS

Topic 1 Ends Here
Tags