In this tutorial, we will design a Flowgorithm flowchart to print a triangle pattern with the * character. The flowchart will create an output text file and print the pattern. Flowgorithm 3.0 supports File Input/Output symbols. This flowchart will print the pattern in the text file.
Print Triangle Pattern
The general steps to create the Flowgorithm flowchart are as follows:
- Launch Flowgorithm Flowchart.
- Declare the flowchart variables.
- Open a text file in write mode.
- Add two for loops to print the required pattern. The outer for loop iterates from 1-> N.
- The inner loop iterates from 1 -> <loop counter variable of the outer loop>
- Develop the line to print with * characters and write to the file in the inner loop. In the outer loop write a new line character.
- Close the file handle at the end of the flowchart. This will release the file to the operating system.
The flowchart uses some Flowgorithm intrinsic functions for its operation. The functions used in the flowchart are as follows:
Save and run the flowchart. Enter the number of rows to print.
The flowchart will create a file pattern<random_number>.txt text file. Open the file to view the output of the flowchart.
That’s it. We have successfully designed a flowchart to create a file and print a triangle pattern in the file.
Flowgorithm flowchart tutorials on this website:
For more information on the Flowgorithm tool, please visit the official website at: