Course Content
Flowgorithm Features
Flowgorithm Features
0/1
Flowgorithm User Interface
Flowgorithm User Interface
0/3
Flowgorithm Flowchart Shapes
Flowgorithm Flowchart Shapes
0/1
Flowgorithm Data Types
Flowgorithm Data Types
0/1
Flowgorithm Comments
Flowgorithm Comments
0/1
Flowgorithm Numbers
Flowgorithm Numbers
0/1
Flowgorithm Strings
Flowgorithm Strings
0/1
Flowgorithm File Format
Flowgorithm File Format
0/1
Flowgorithm Program Attributes
Flowgorithm Program Attributes
0/1
IPO Chart
IPO Chart ( Input, Process and Output Chart )
0/2
First Flowgorithm Flowchart
First Flowgorithm Flowchart
0/2
Add Two Numbers Flowchart
Add Two Numbers Flowchart
0/2
Flowgorithm Quiz
Flowgorithm Quiz
0/1
Flowgorithm Beginner Exercises
Flowgorithm Beginner Exercises
0/1
Flowgorithm Beginner
About Lesson

Create Variables

The Declare statement creates variables in the flowchart. This symbol can also be used to create multiple variables. Creating variables in the flowchart is a two-step process.

  • Declare the Variable
  • Store/Assign a value to the Variable.

Examples

Let’s create a single variable called ‘age’ of the datatype Integer. The steps are outlined below:

Launch Flowgorithm software.

Right-click on the flow control line. Choose the Declare symbol under the Variables section. 

Create Single Variable Flowgorithm

 

In the Variables Names: box, specify the variable name as age. Choose the Type: as Integer. 

Click on the OK button to create the variable. 

Create Variable Flowgorithm Window

Store a value

When we create a variable with the Declare symbol, its initial value is undefined or uninitialized. We can use the Assign symbol to store a value in the variable. 

 

Points to remember

A variable must be declared before it can be used in the flowchart. The interpreter will throw an error if it encounters a variable that is not declared. 

Variable Not Declared Flowgorithm

For example, the error screen shows that the sum variable is used without declaration.

 

A variable can change its value during the program’s lifetime. Let’s understand this concept with an example. 

Create a variable called x. Let’s assign multiple values to the variable x and check its output. 

Flowgorithm Variable Multiple Assignments

Notice that variable x holds different values we assigned during the flowchart run. Initially, x holds a value of 56, but with the second assignment statement, we changed the x value to 79.

Join the conversation