SlideShare a Scribd company logo
C
PSEUDOCODE & FLOWCHART
EXAMPLES
10 EXAMPLES
www.csharp-console-examples.com
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.
• 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.
Pseudecode Syntax
• FOR THOSE TUTORIALS I'LL USE THAT SYNTAX
• 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 & Flowchart Example 1
Add Two Numbers
1
2
3
4
5
6
7
8
9
BEGIN
NUMBER s1, s2, sum
OUTPUT("Input number1:")
INPUT s1
OUTPUT("Input number2:")
INPUT s2
sum=s1+s2
OUTPUT sum
END
Pseudocode & Flowchart Example 2
Calculate Perimeter of Rectangle
1
2
3
4
5
6
7
8
9
BEGIN
NUMBER b1,b2,area,perimeter
INPUT b1
UNPUT b2
area=b1*b2
perimeter=2*(b1+b2)
OUTPUT alan
OUTPUT perimeter
END
Pseudocode & Flowchart Example 3
Find Perimeter Of Circle using Radius
2
3
4
5
6
BEGIN
NUMBER r, perimeter
INPUT r
area=3.14*2*r
OUTPUT perimeter
END
Pseudocode & Flowchart Example 4
Calculate sales taxes
3
4
5
6
7
8
9
10
11
12
13
14
15
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 & Flowchart Example 5
Check a Number is Positive or Negative
5
6
7
8
9
10
11
12
13
14
15
16
BEGIN
NUMBER num
OUTPUT "Enter a Number"
OKU num
IF num>0 THEN
OUTPUT "Entered number is positive"
ELSE IF num <0 THEN
OUTPUT "Entered number is negative"
ELSE
OUTPUT "Entered number is zero"
ENDIF
END
Pseudocode & Flowchart Example 6
Find the biggest of three (3) Numbers
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
BEGIN
NUMBER num1,num2,num3
INPUT num1
INPUT num2
INPUT num3
IF num1>num2 AND num1>num3 THEN
OUTPUT num1+ "is higher"
ELSE IF num2 > num3 THEN
OUTPUT num2 + "is higher"
ELSE
OUTPUT num3+ "is higher"
ENDIF
END
Pseudocode & Flowchart Example 7
Print Numbers from 1 to 100
2
3
4
5
6
7
8
BEGIN
NUMBER counter
FOR counter = 1 TO 100 STEP 1 DO
OUTPUUT counter
ENDFOR
END
Pseudocode & Flowchart Example 8
Read 50 numbers and find their sum
BEGIN
NUMBER counter, sum=0, num
FOR counter=1 TO 50 STEP counter DO
OUTPUT "Enter a Number"
INPUT num
sum=sum+num
ENDFOR
OUTPUT sum
END
Pseudocode & Flowchart Example 9
Read 10 numbers and find sum of even numbers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
BEGIN
NUMBER counter, sum=0, num
FOR counter=1 TO 10 STEP 1 DO
OUTPUT "Enter a Number"
INPUT num
IF num % 2 == 0 THEN
sum=sum+num
ENDIF
ENDFOR
OUTPUT sum
BİTİR
Pseudocode & Flowchart Example 10
Calculate the Square Root of a Number
BEGIN
NUMBER root=1, counter=0,num
OUTPUT "Enter a number for calculate the root"
INPUT num
WHILE sayac < sayi+1 THEN
i=i+1
root=(num/root+root)/2
END WHILE
OUTPUT root
END
csharp-console-examples.com
For more pseudocode ve flowchart
examples
click here

More Related Content

What's hot

Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
Deva Singh
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and Flowchart
ALI RAZA
 
Pseudocode
PseudocodePseudocode
Pseudocode
Harsha Madushanka
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
Sachin Goyani
 
While loop
While loopWhile loop
While loop
Feras_83
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
fazli khaliq
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
amber chaudary
 
While , For , Do-While Loop
While , For , Do-While LoopWhile , For , Do-While Loop
While , For , Do-While Loop
Abhishek Choksi
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
Gautam Roy
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchartlotlot
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
REHAN IJAZ
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
sneha2494
 
Pointers C programming
Pointers  C programmingPointers  C programming
Pointers C programming
Appili Vamsi Krishna
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
vijayapraba1
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?
Angela DeHart
 
Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
rajkumar1631010038
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
Sokngim Sa
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
Jordan Delacruz
 

What's hot (20)

Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
pseudocode and Flowchart
pseudocode and Flowchartpseudocode and Flowchart
pseudocode and Flowchart
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
While loop
While loopWhile loop
While loop
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
 
Conditional statement c++
Conditional statement c++Conditional statement c++
Conditional statement c++
 
While , For , Do-While Loop
While , For , Do-While LoopWhile , For , Do-While Loop
While , For , Do-While Loop
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
 
Pseudocode-Flowchart
Pseudocode-FlowchartPseudocode-Flowchart
Pseudocode-Flowchart
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
 
Pointers C programming
Pointers  C programmingPointers  C programming
Pointers C programming
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
 
What is an algorithm?
What is an algorithm?What is an algorithm?
What is an algorithm?
 
Loops in c++ programming language
Loops in c++ programming language Loops in c++ programming language
Loops in c++ programming language
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 

Similar to Pseudocode & flowchart examples

8234.docx
8234.docx8234.docx
8234.docx
singsang3
 
C++ Course - Lesson 1
C++ Course - Lesson 1C++ Course - Lesson 1
C++ Course - Lesson 1
Mohamed Ahmed
 
Control structure of c
Control structure of cControl structure of c
Control structure of c
Komal Kotak
 
A simple project of computer program.docx
A simple project of computer program.docxA simple project of computer program.docx
A simple project of computer program.docx
write4
 
12-Lec - Repetition For Loop.pptx
12-Lec - Repetition For Loop.pptx12-Lec - Repetition For Loop.pptx
12-Lec - Repetition For Loop.pptx
AqeelAbbas94
 
Slide07 repetitions
Slide07 repetitionsSlide07 repetitions
Slide07 repetitions
altwirqi
 
Loops
LoopsLoops
Algorithm Design and Problem Solving [Autosaved].pptx
Algorithm Design and Problem Solving [Autosaved].pptxAlgorithm Design and Problem Solving [Autosaved].pptx
Algorithm Design and Problem Solving [Autosaved].pptx
KaavyaGaur1
 
Lec7 - Loops updated.pptx
Lec7 - Loops updated.pptxLec7 - Loops updated.pptx
Lec7 - Loops updated.pptx
NaumanRasheed11
 
loopingstatementinpython-210628184047 (1).pdf
loopingstatementinpython-210628184047 (1).pdfloopingstatementinpython-210628184047 (1).pdf
loopingstatementinpython-210628184047 (1).pdf
DheeravathBinduMadha
 
Python
PythonPython
Python
MeHak Gulati
 
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
Béo Tú
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
Ebad ullah Qureshi
 
3.2 looping statement
3.2 looping statement3.2 looping statement
3.2 looping statement
PhD Research Scholar
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop
kapil078
 
Workbook_2_Problem_Solving_and_programming.pdf
Workbook_2_Problem_Solving_and_programming.pdfWorkbook_2_Problem_Solving_and_programming.pdf
Workbook_2_Problem_Solving_and_programming.pdf
DrDineshenScientist
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
RaginiJain21
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements looping
MomenMostafa
 
Bikalpa_Thapa_Python_Programming_(Basics).pptx
Bikalpa_Thapa_Python_Programming_(Basics).pptxBikalpa_Thapa_Python_Programming_(Basics).pptx
Bikalpa_Thapa_Python_Programming_(Basics).pptx
Bikalpa Thapa
 

Similar to Pseudocode & flowchart examples (20)

8234.docx
8234.docx8234.docx
8234.docx
 
C++ Course - Lesson 1
C++ Course - Lesson 1C++ Course - Lesson 1
C++ Course - Lesson 1
 
Control structure of c
Control structure of cControl structure of c
Control structure of c
 
A simple project of computer program.docx
A simple project of computer program.docxA simple project of computer program.docx
A simple project of computer program.docx
 
12-Lec - Repetition For Loop.pptx
12-Lec - Repetition For Loop.pptx12-Lec - Repetition For Loop.pptx
12-Lec - Repetition For Loop.pptx
 
Slide07 repetitions
Slide07 repetitionsSlide07 repetitions
Slide07 repetitions
 
Loops
LoopsLoops
Loops
 
Algorithm Design and Problem Solving [Autosaved].pptx
Algorithm Design and Problem Solving [Autosaved].pptxAlgorithm Design and Problem Solving [Autosaved].pptx
Algorithm Design and Problem Solving [Autosaved].pptx
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Lec7 - Loops updated.pptx
Lec7 - Loops updated.pptxLec7 - Loops updated.pptx
Lec7 - Loops updated.pptx
 
loopingstatementinpython-210628184047 (1).pdf
loopingstatementinpython-210628184047 (1).pdfloopingstatementinpython-210628184047 (1).pdf
loopingstatementinpython-210628184047 (1).pdf
 
Python
PythonPython
Python
 
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
 
3.2 looping statement
3.2 looping statement3.2 looping statement
3.2 looping statement
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop
 
Workbook_2_Problem_Solving_and_programming.pdf
Workbook_2_Problem_Solving_and_programming.pdfWorkbook_2_Problem_Solving_and_programming.pdf
Workbook_2_Problem_Solving_and_programming.pdf
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements looping
 
Bikalpa_Thapa_Python_Programming_(Basics).pptx
Bikalpa_Thapa_Python_Programming_(Basics).pptxBikalpa_Thapa_Python_Programming_(Basics).pptx
Bikalpa_Thapa_Python_Programming_(Basics).pptx
 

Recently uploaded

Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 

Recently uploaded (20)

Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 

Pseudocode & flowchart examples

  • 1. C PSEUDOCODE & FLOWCHART EXAMPLES 10 EXAMPLES www.csharp-console-examples.com
  • 2. 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. • 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.
  • 3. Pseudecode Syntax • FOR THOSE TUTORIALS I'LL USE THAT SYNTAX • 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
  • 4. Pseudocode & Flowchart Example 1 Add Two Numbers 1 2 3 4 5 6 7 8 9 BEGIN NUMBER s1, s2, sum OUTPUT("Input number1:") INPUT s1 OUTPUT("Input number2:") INPUT s2 sum=s1+s2 OUTPUT sum END
  • 5. Pseudocode & Flowchart Example 2 Calculate Perimeter of Rectangle 1 2 3 4 5 6 7 8 9 BEGIN NUMBER b1,b2,area,perimeter INPUT b1 UNPUT b2 area=b1*b2 perimeter=2*(b1+b2) OUTPUT alan OUTPUT perimeter END
  • 6. Pseudocode & Flowchart Example 3 Find Perimeter Of Circle using Radius 2 3 4 5 6 BEGIN NUMBER r, perimeter INPUT r area=3.14*2*r OUTPUT perimeter END
  • 7. Pseudocode & Flowchart Example 4 Calculate sales taxes 3 4 5 6 7 8 9 10 11 12 13 14 15 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
  • 8. Pseudocode & Flowchart Example 5 Check a Number is Positive or Negative 5 6 7 8 9 10 11 12 13 14 15 16 BEGIN NUMBER num OUTPUT "Enter a Number" OKU num IF num>0 THEN OUTPUT "Entered number is positive" ELSE IF num <0 THEN OUTPUT "Entered number is negative" ELSE OUTPUT "Entered number is zero" ENDIF END
  • 9. Pseudocode & Flowchart Example 6 Find the biggest of three (3) Numbers 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 BEGIN NUMBER num1,num2,num3 INPUT num1 INPUT num2 INPUT num3 IF num1>num2 AND num1>num3 THEN OUTPUT num1+ "is higher" ELSE IF num2 > num3 THEN OUTPUT num2 + "is higher" ELSE OUTPUT num3+ "is higher" ENDIF END
  • 10. Pseudocode & Flowchart Example 7 Print Numbers from 1 to 100 2 3 4 5 6 7 8 BEGIN NUMBER counter FOR counter = 1 TO 100 STEP 1 DO OUTPUUT counter ENDFOR END
  • 11. Pseudocode & Flowchart Example 8 Read 50 numbers and find their sum BEGIN NUMBER counter, sum=0, num FOR counter=1 TO 50 STEP counter DO OUTPUT "Enter a Number" INPUT num sum=sum+num ENDFOR OUTPUT sum END
  • 12. Pseudocode & Flowchart Example 9 Read 10 numbers and find sum of even numbers 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 BEGIN NUMBER counter, sum=0, num FOR counter=1 TO 10 STEP 1 DO OUTPUT "Enter a Number" INPUT num IF num % 2 == 0 THEN sum=sum+num ENDIF ENDFOR OUTPUT sum BİTİR
  • 13. Pseudocode & Flowchart Example 10 Calculate the Square Root of a Number BEGIN NUMBER root=1, counter=0,num OUTPUT "Enter a number for calculate the root" INPUT num WHILE sayac < sayi+1 THEN i=i+1 root=(num/root+root)/2 END WHILE OUTPUT root END
  • 14. csharp-console-examples.com For more pseudocode ve flowchart examples click here