0% found this document useful (0 votes)
699 views3 pages

Pseudocode With Flowchart Examples

Pseudocode is an informal high-level description of a program that uses the syntax of a programming language for human comprehension but cannot be compiled. It allows programmers to plan programs in plain English before writing the actual code. Pseudocode does not have a standard syntax but commonly uses keywords like INPUT, OUTPUT, IF, THEN, ELSE, WHILE and FOR to indicate program flow and logic. The document provides examples of pseudocode programs for adding two numbers, calculating the area of a circle, sales tax calculation, finding the perimeter of a circle, and checking the greatest of two numbers.

Uploaded by

salman ahsan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
699 views3 pages

Pseudocode With Flowchart Examples

Pseudocode is an informal high-level description of a program that uses the syntax of a programming language for human comprehension but cannot be compiled. It allows programmers to plan programs in plain English before writing the actual code. Pseudocode does not have a standard syntax but commonly uses keywords like INPUT, OUTPUT, IF, THEN, ELSE, WHILE and FOR to indicate program flow and logic. The document provides examples of pseudocode programs for adding two numbers, calculating the area of a circle, sales tax calculation, finding the perimeter of a circle, and checking the greatest of two numbers.

Uploaded by

salman ahsan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

What is 

Pseudocode
Pseudocode is a compact and informal high-level description of a program using
the conventions of a programming language, but intended more for humans.

Pseudocode is not an actual programming language. So it cannot be compiled


into an executable program. It uses short terms or simple English language
syntaxes to write code for programs before it is actually converted into a specific
programming language.

And there is no pseudocode standard syntax and so at times it becomes slightly


confusing when writing Pseudocode and so let us understand pseudo code with
an example.

 INPUT – indicates a user will be inputting something


 OUTPUT – indicates that an output will appear on the screen
 WHILE – a loop (iteration that has a condition at the beginning)
 FOR – a counting loop (iteration)
 REPEAT – UNTIL – a loop (iteration) that has a condition at the end
 IF – THEN – ELSE – a decision (selection) in which a choice is made
any instructions that occur inside a selection or iteration are usually
indented

Pseudocode Examples (Algorithms Examples in Pseudocode with Flow chart)


Pseudocode Example 1: Add Two Numbers.

BEGIN Flowchart of Pseudocode


NUMBER s1, s2, sum
OUTPUT ("Input number1:")
INPUT s1
BEGIN
OUTPUT ("Input number2:")
INPUT s2
sum=s1+s2
OUTPUT sum s1
END

s2

Sum=s1+s2

Sum

END
Pseudocode Example 2: Find Area of a circle

BEGIN
NUMBER r, area
INPUT r
area=3.14*r*r
OUTPUT area
END

Pseudocode Example 3: Calculate sales taxes 


BEGIN
NUMBER price, tax, taxRate, total
 
OUTPUT "Enter Product Price"
INPUT price
OUTPUT "Enter tax rate amoung 1 and 100"
OKU taxRate
 
tax= price* taxRate/100
total= price + tax
 
OUTPUT "Product tax="+tax
OUTPUT "Product total price ="+total
 
END
Pseudocode Example 5: Find Perimeter Of Circle using Radius

BEGIN
NUMBER r, perimeter
INPUT r
perimeter=2*3.14*r
OUTPUT perimeter
END

Pseudocode Example 5 To check


greatest of two numbers 
Step 1: Start
Step 2: get a,b value
Step 3: check if(a>b) print a is greater
Step 4: else b is greater
Step 5: Stop
 

You might also like