Number Positive or Negative flowchart in RAPTOR


In this post, we will learn how to design a flowchart to decide if the user entered number is negative or positive. The Flowchart uses the Selection symbol. A selection-control symbol allows you to make decisions in the flowchart.

Basic Mathematics

n < 0  n is negative.

If the given number is less than 0 -> the number is negative.

n > 0 n is positive.

If the number is > 0 the number is positive.

Zero is a special case.

Number positive or negative

Create RAPTOR flowchart:

Launch the RAPTOR flowchart tool.
We need a variable to hold the user entered number.
Let us call it n.



Drag and drop the Assignment symbol.

n <- 0

Input Symbol

Drag and drop one Input symbol for the user prompt.



Selection Symbol

Now we need one Selection symbol. Drag and drop the selection symbol.

Double click on the diamond box n < 0




Ouput Symbol

Drop two Output symbols in the Yes path flow and the other in the No path flow.



In the Yes path output the number is negative.



In the No path add another selection to decide zero or positive.



Execute and Test the flowchart.

Flowchart run output

Example Flowchart Output

Print the number if its positive or negative number.
For example:
Input: 56

Output : 56 is a positive number.

Input : -45

Output : -45 is a negative number.

This is similar to what we do in programming code using the if-then statements to make decisions. We can execute the if-then flow using the selection symbol in the Raptor flowchart.


RAPTOR tutorial page:

Flowchart examples:

RAPTOR official website: