0% found this document useful (0 votes)
2 views

C Programing Ppt

The document outlines the process of algorithm and program development, including problem definition, analysis, design, coding, testing, and maintenance. It explains key concepts such as algorithms, flowcharts, and programming languages, detailing their characteristics, advantages, and differences between machine and assembly languages. Additionally, it provides examples and exercises for writing algorithms and flowcharts.

Uploaded by

Vansh Kalia
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

C Programing Ppt

The document outlines the process of algorithm and program development, including problem definition, analysis, design, coding, testing, and maintenance. It explains key concepts such as algorithms, flowcharts, and programming languages, detailing their characteristics, advantages, and differences between machine and assembly languages. Additionally, it provides examples and exercises for writing algorithms and flowcharts.

Uploaded by

Vansh Kalia
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

DEE-402 COMPUTER PROGRAMMING AND APPLICATIONS

1. Algorithm and Program Development:

Steps in development of a program, Flow-charts,


algorithm development, Introduction to various computer
languages, Concept of interpreter, compiler, high level
language, machine language and Assembly Language.
Syllabus
REFERENCE BOOKS

• LET US C by Yashavant Kanetkar.

• C programming by e balagurusamy.
Steps in development of a program
Problem Definition:-Identity the problem, what is requirement, what
should be the output.

Problem Analysis:- Finding/gathering of resources like variables, data


types, functions. Language to be used etc.

Design:- It can be done it two ways , Algorithm and Flowcharts, Algorithm


is list of instructions/steps to solve the problem and Flowcharts is pictorial
representation of the problem.

Coding:-Here coding of the program is done in the desired programming


language i.e. C , C++, Java etc.

Testing:- Here we test the code developed in previous steps and check
whether we are getting the desired result.

Maintenance:-During this phase program is used by end users and


changes if any may be made after repeating all the steps
ALGORITHM
The word “algorithm” relates to the name of the mathematician Al-
khowarizmi, which means a procedure or a technique.
Software Engineer commonly uses an algorithm for planning and
solving the problems. An algorithm is a sequence of steps to solve a
particular problem

Algorithm has the following characteristics.

Input:- An algorithm may or may not require input.

Output:- : Each algorithm is expected to produce at least one result.

Definiteness:- Each instruction must be clear and unambiguous.

Finiteness:-It should terminate after finite steps.


Advantages of algorithm
• It is a step-wise representation of a solution to a
given problem, which makes it easy to understand.

• An algorithm uses a definite procedure.

• It is not dependent on any programming language,


so it is easy to understand for anyone even without
programming knowledge.

• Every step in an algorithm has its own logical


sequence so it is easy to debug.
HOW TO WRITE ALGORITHMS
Step 1 Define your algorithms input: Many algorithms take in data to be
processed, e.g. to calculate the area of rectangle input may be the rectangle
height and rectangle width
Step 2 Define the variables: Algorithm's variables allow you to use it for
more than one place. We can define two variables for rectangle height and
rectangle width as HEIGHT and WIDTH (or H & W). We should use
meaningful variable name e.g. instead of using H & W use HEIGHT and
WIDTH as variable name.
Step 3 Outline the algorithm's operations: : Use input variable for
computation purpose, e.g. to find area of rectangle multiply the HEIGHT
and WIDTH variable and store the value in new variable (say) AREA. An
algorithm's operations can take the form of multiple steps and even branch,
depending on the value of the input variables.
Step 4 Output the results of your algorithm's operations: In case of area
of rectangle output will be the value stored in variable AREA. if the input
variables described a rectangle with a HEIGHT of 2 and a WIDTH of 3, the
algorithm would output the value of 6
FLOWCHART
Unlike an algorithm, Flowchart uses different symbols to design a solution to a
problem. Graphical representation of sequence of steps to solve a problem. It is
another commonly used programming tool. By looking at a Flowchart one can
understand the operations and sequence of operations performed in a system.
Flowchart is often considered as a blueprint of a design used for solving a specific
problem.

Advantages of flowchart:
Flowchart is an excellent way of communicating the logic of a program.
Easy and efficient to analyze problem using flowchart.
During program development cycle, the flowchart plays the role of a blueprint,
which makes program development process easier.
After successful development of a program, it needs continuous timely
maintenance during the course of its operation. The flowchart makes program
or system maintenance easier.
It is easy to convert the flowchart into any programming language code.
Symbols used in Flowchart
Example
Exercise

• Write an algorithm to find the largest of three


numbers
• Draw a flowchart to find the largest of three
numbers.
Programming Language- Computer is an electronic device which works on the
instructions provided by the user. Such a computer understandable language is known as
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 the format that can be
interpreted by the computer system Computer

Machine Language- 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

Example: The program to add two numbers in memory and print the result look something
like the Following:
00100000000000110011100
001111000000111111000111
10011110001110110011010
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.
Example MOV AX, DX
Machine language
Machine language is the low level programming
language. Machine language can only be represented
by 0s and 1s. In earlier when we have to create a picture
or show data on the screen of the computer then it is
very difficult to draw using only binary digits(0s and
1s). For example: To write 120 in the computer system
its representation is 1111000. So it is very difficult to
learn. To overcome this problem the assembly language
is invented.
Assembly language
Assembly language is the more than low level and
less than high-level language so it is intermediary
language. Assembly languages use numbers, symbols,
and abbreviations instead of 0s and 1s.For example: For
addition, subtraction and multiplications it uses symbols
likes Add, sub and Mul, etc.
Sr.no
Machine Language Assembly Language
1
Machine language is only understand Assembly language is only understand
by the computers. by human beings not by the computers.

2
In machine language data only
In assembly language data can be
represented with the help of binary
represented with the help of mnemonics
format(0s and 1s), hexadecimal and
such as Mov, Add, Sub, End etc.
octadecimal.

3
Assembly language is easy to
Machine language is very difficult to
understand by the human being as
understand by the human beings.
compare to machine language.

4
Modifications and error fixing cannot Modifications and error fixing can be
be done in machine language. done in assembly language.

5
Machine language is very difficult to Easy to memorize the assembly
memorize so it is not possible to language because some alphabets and
learn the machine language. mnemonics are used.

You might also like