Before you read this shot, you should have Raptor software installed in your system.
In Raptor, the
oval shape is used for start and stop, the
rectangular box is used for assignment,
rhombus with arrow top left side is used for input,
rhombus shape with arrow right down is used for output, and a
rectangular box with arrow middle right side is for calling functions, etc.
First, click on the
input symbol to take the number as an
Then, click between
stop to insert it.
After inserting that block, double click on it, and a new window will open asking for the message and variable name. You can give a message to the user, like in this flowchart, that says, “Enter a number: and a variable name to store the input value(in this flowchart, I am taking ‘n’)”.
After that, click on the selection block; then, click between the input and the end block in the flowchart to insert the selection block in the flowchart.
Now, double-click on the
diamond shape of the selection block to give a condition to check.
In this flowchart,
n%2==0 is the condition used to check if a number is even or odd.
In the above condition, ‘%’ is modulus, meaning we will get a remainder.
We use ‘==’ to check the condition and ‘=’ to assign.
Now, click on the output block and insert them in the selection block (left one block and right one block).
Double click on output block, which is inserted in selection block, and a new window will open. Within this window, you will have variable name +“message” (in the above flowchart, n+" is an even number", the right side output block gives n+" is an odd number".
Click on the play button in the tools menu to run the flowchart.
View all Courses