You are on page 1of 17

FLOW CHART BASED ON DO-WHILE

CONDITION
do
{
statement;
}
while(condition);
Pseudo code
• A pseudocode is another way of representing an algorithm. It is
considered as a non-formal language that helps programmers to
write algorithm.
• It is a detailed description of instructions that a computer must
follow in a particular order.
• It is intended for human reading and cannot be executed directly by
the computer. No specific standard for writing a pseudocode exists.
• The word “pseudo” means “not real,” so “pseudocode” means “not
real code”. Following are some of the frequently used keywords
while writing pseudocode:
• INPUT
• COMPUTE
• PRINT
• INCREMENT
• DECREMENT
• IF/ELSE
• WHILE
• TRUE/FALSE
Q1.Write an algorithm to display the sum of two
numbers entered by user using both pseudocode and
flowchart.
• Pseudocode steps:-
• Step 1:- input num 1
• Step 2:- input num 2
• Step 3:- compute result = num 1+ num 2
• Step 4:- print result
START

INPUT num1, num2

Result= num1+num2

Print Result

Stop
Difference between algorithm and pseudo
code
Algorithm Pseudo code

1.Systematic logic approach to solve any program. 1.It is simple version of programming code that does
It is written in natural language. not require any strict programming language syntax.
2. It has specific syntax of the programming 2. It does not have specific syntax like any of the
language and can be executed on computer. programming language and thus cannot be
executed on computer.
Q. Write an algorithm to calculate area and perimeter of a rectangle, using both
pseudocode and flowchart. Pseudocode for calculating area and perimeter of a
rectangle?
Q. Write an algorithm to calculate area and perimeter of a rectangle, using both
pseudocode and flowchart. Pseudocode for calculating area and perimeter of a
rectangle?

• input length
• input breadth
• compute Area = length * breadth
• print Area
• compute Perimeter = 2 * (length + breadth)
• Print perimeter
Programming language
• A programming language is a computer language that is used
by programmers (developers) to communicate with computers.
It is a set of instructions written in any specific language ( C, C++,
Java, Python) to perform a specific task.
• A programming language is mainly used to develop desktop
applications, websites, and mobile applications.
Types of programming language
Low level language
• Low-level language is machine-dependent (0 s and
1s) programming language.
• The processor runs low- level programs directly without the need
of a compiler or interpreter, so the programs written in low-level
language can be run very fast.
Low-level language is further divided into
two parts :-

1. •Machine language

•Assembly
2.
language
Machine language
• Machine language is a type of low-level programming language.
• It is also called as machine code or object code.
• Machine language is easier to read because it is normally displayed
in binary or hexadecimal form (base 16) form.
• It does not require a translator to convert the programs because
computers directly understand the machine language programs.
• The advantage of machine language is that it helps the programmer
to execute the programs faster than the high-level programming
language.
Assembly language
• Assembly language (ASM) is also a type of low-level programming
language that is designed for specific processors.
• It represents the set of instructions in a symbolic and human-
understandable form.
• It uses an assembler to convert the assembly language to machine
language.
• The advantage of assembly language is that it requires less memory
and less execution time to execute a program.

You might also like