Pseudocode Examples – Programming, Pseudocode Example, C# Programming Example
General Pseudocode Examples

Pseudocode Examples

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

 

Some Keywords That Should be Used

For looping and selection, The keywords that are to be used include Do While…EndDo; Do Until…Enddo; Case…EndCase; If…Endif; Call … with (parameters); Call; Return ….; Return; When; Always use scope terminators for loops and iteration.As verbs, use the words Generate, Compute, Process, etc. Words such as set, reset, increment, compute, calculate, add, sum, multiply, … print, display, input, output, edit, test , etc. with careful indentation tend to foster desirable pseudocode.

Do not include data declarations in your pseudocode.

Pseudocode Examples ( Algorithms Examples in Pseudocode )

There are 18 pseudocode tutorial in this post. The Pseudocode examples  go from beginner to advanced. You will find a lot of for loop, if else and basics examples. Pseudocode and flowchart examples are in following the post.

 

Pseudocode Example 1: Add Two Numbers.(Simple Pseudocode  Example)

 

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

 

Pseudocode Example 2: Calculate Area and Perimeter of Rectangle (Simple Pseudocode  Example)

 

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

Pseudocode Example 3: Find Area and Perimeter of a Square (Simple Pseudocode Example)

Pseudocode Example 4: Find Area Of Circle using Radius (Simple Pseudocode  Example)

Flowchart of Pseudocode

 

Pseudocode Example 5: Find Perimeter Of Circle using Radius (Simple Pseudocode  Example)

Flowchart of Pseudocode

 

Pseudocode Example 6: Calculate sales taxes (Simple Pseudocode  Example)

 

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

 

Pseudocode Example 7:  Solve Quadratic Equation (Pseudocode If Else Example)

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

Pseudocode Example 8: issue for driver licence (Pseudocode If Else Example)

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

 

Pseudocode Example 9: Check a Number is Positive or Negative (Pseudocode If Else Example)

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

Pseudocode Example 10: Find the biggest of three (3) Numbers (Pseudocode If Else Example)

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

 

 

Pseudocode Example 11: Print Numbers from 1 to 100. (Pseudocode For Loop Example)

Flowchart of Pseudocode

 

 

Pseudocode Example 12: Find Sum of Natural Numbers (1 to 100). (Pseudocode For Loop Example)

Pseudocode Example 13: Read 50 numbers and find their sum and average. (Pseudocode For Loop Example)

Flowchart of Pseudocode

flowchart examples, flowchart examples for student, flowchart examples for programming

 

 

Pseudocode Example 14: Read 10 numbers and find sum of even numbers. (Pseudocode For Loop Example)

Flowchart of Pseudocode

 

Pseudocode Example 15: Find the sum of all elements of array. (Pseudocode For Loop Example)

Flowchart of Pseudocode

 

 

Pseudocode Example 16: Calculate square of a number (Simple Pseudocode  Example)

 

Alternative 1:

 

Alternative 2:

 

 

Pseudocode Example 17: Calculate the Square Root of a Number (Pseudocode For Loop Example)

 

 

flowchart examples, flowchart examples for student, flowchart examples for programming

 

Pseudocode Example 18: Swap two variables with using a temporary variable (Simple Pseudocode  Example)

 

Pseudocode Example 19: Swap two variables without using a temporary variable (Simple Pseudocode  Example)

 

Pseudocode Example 20: Print Numbers from 1 to n. (Pseudocode For Loop Example)

 

Pseudocode Example 21: Calculate the Sum and Average of n Number. (Pseudocode For Loop Example)

Pseudocode Example 22: Design the algorithm and flowchart that finds and display the larger of the two numbers given different from each other.

 

Pseudocode Example 23: Perform the application that calculates the area of the triangle whose height and base length entered by the keyboard.

 

Pseudocode Example 24: The voltage (V) between the poles of a conductor is equal to the product of the current (I) passing through the conductor and the resistance (R) present on the conductor. It’s demonstrated by the V = I * R formula. What is the algorithm of the program that calculates the voltage between the poles of the conductor by using the formula according to the current and resistance values entered by the user.

Pseudocode Example 25: What is the algorithm that the number entered by the user from the keyboard fully divided if it is divided into 3 and 5 .

7 Comments

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: