TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Flowgorithm

Flowgorithm Flowchart Example : Reverse Number

Overview

In this tutorial, we will look at a simple Flowgorithm flowchart example. We will design a flowchart to reverse a given number. Let’s first see a sample example input and output of the flowchart.

Example

If the user provides the following input to the flowchart : 7836

The expected output of the flowchart is : 6387

Psuedocode

START
DECLARE Integer number, digit, result

SET result = 0
DISPLAY “Please enter a number = “
IINPUT number
DISPLAY “Given number = “, number
WHILE number >= 1
             SET digit = number MOD 10
             SET result = result * 10 + digit
             SET number = number / 10
ENED WHILE
DISPLAY “Reverse of the number = “, result
END

 

Flowgorithm Flowchart Example

We will prompt the user for a number. We will store this in a variable number.

Using the WHILE loop statement, inside the loop:

We will extract each digit of the given number.

number MOD 10

This will give the last digit of the number. We will store this digit in a variable digit.

For example, 1345 MOD 10 will store 5 in the digit.

We will build the reverse of the number using the variable result

number / 10

We move to the next digit by dividing the number by 10.

For example,

number = 1345 / 10  will store 134 in the variable number.

 

When all the digits are covered in the number variable, it will become 0. The WHILE loop terminates as the loop condition is evaluated to False.

 

Flowgorithm Flowchart Example

Sample Output

Run the flowchart and verify the output of the flowchart.

Reverse Number Flowgorithm Output

—

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at:

http://flowgorithm.org/

Related Posts

Print Triangle Pattern Flowchart

Flowgorithm /

Print Triangle Pattern Flowchart

Flowgorithm Breakpoint Symbol

Flowgorithm /

Flowgorithm Conditional Breakpoint Statement

File Read Declare Variables

Flowgorithm /

Flowgorithm Read Numbers from File Example

File Search Input File Flowgorithm

Flowgorithm /

Search Text File Flowchart Example

Flowgorithm Turtle Graphics Symbols

Flowgorithm /

Flowgorithm Turtle Graphics Symbols

‹ Flowgorithm Pass By Value Example› Flowgorithm Identifiers

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com