Flow Charts

What is a flow chart ?

·

2 min read

A flow chart is a thought process of what you are gonna make or create.

Let us first understand the basics through an example ->

Ques. Take a car name and output "He is having [car name] car.

Let us get started with symbols used in the flow chart :

  1. start / stop -> oval or circle

  2. Input / output -> parallelogram

  3. Processing -> rectangle

  4. condition -> rhombus

  5. flow direction -> Arrow

EXAMPLE 2: Check if a number is a prime number or not.

Suppose your number = 7 and the numbersyou gonna check whether they are divisible by 7 not are [ 2,3,4,5,6] , now

  1. c = 2

  2. c < num ( 2 < 7) [yes it is smaller than 7]

  3. num % c =0 ( 7 % 2 = 1), so c gets incremented by one number.

  4. c = c + 1 (c = 3)

  5. Again check ( 3 < 7) yes it is smaller .

  6. Now moves to the next ( 7 % 3 =1) , again c gets incremented by one number.

  7. c = c + 1 ( c = 4)

  8. Again check ( 4 < 7)yes it is smaller than 7

  9. Now move to the next step (7 % 4 =1), again c gets incremented by one number ,and it goes like this in the loop until c = 7.

  10. When it checks now (c < num) = ( 7 < 7) it will move out of the loop and prints [ 7 is prime number].

Did you find this article valuable?

Support Idealead by becoming a sponsor. Any amount is appreciated!