Programming flowcharts for C Language

Preview:

DESCRIPTION

Programming flowcharts for C Language

Citation preview

Flowchart’s

Nitin Chandwani

• Flowchart are the graphical representation of a solution to a particular problem, which comes under the category of Programming Practices and Techniques, in simple words flowchart is a graphical representation of a program.

• Flowchart are symbolic diagrams which shows type of data(numeric, character etc.), data flow, control flow and programming logics and algorithms.

• The first flowchart was created by Von Neumann in 1945.

• Flowchart are important for planning and working of a program

• Flowcharts decreases our efforts i.e. they are easy to understand and check logics and algorithms.

• Flowcharts have became necessity as it is important to do paper work i.e. making logic and algorithm before creating a program on a Machine.

Symbols of Flowcharts

1) Terminal Symbol :

This symbol shows the beginning or ending of a program i.e. first and the last element of flowchart.It is single directional i.e. only one flow line can be connected with terminal symbol.

2. Input/output Symbol :

A parallelogram is used to represent input and output operation, it can have 2 flow lines.

3. Process Symbol :

This symbol is used for showing mathematical calculation, change in data or any type of processing on data, it can have 2 flow lines.

4. Flow Line :

A straight line between two symbols shows the logical flow of control in a program is flow line.

5. Decision Symbol :

Diamond symbol is used to show or apply condition , it has single flow line for input and two flow lines for output i.e. one for true part and one for false part.

6. Connector Symbol :

Connector symbol (circle) are used to connect separate portions of flow chats, it can have single flow line.

A

Steps for Programming Practices and Techniques

Step 1 :Requirement :

Input : Quality :Quantity :

Process :Output :

This step the data or information required by program is written.

Step 2 :Flowchart : It refers to creation of flowchart.

Step 3 :

Dry Run : Dry run is step by step execution of flow chart that means checking and removing errors from the flowchart if any, It can also be defined as executing and giving output(result) from the flowchart on paper.

Step 4 :Source Code : It is the process of creating program/code on a computer.

Step 5 :Debugging : Debugging is a process of

removing errors from the program.

Step 6 :Documentation : It is process of creating

documentation about the program i.e. working of program, help etc.

Examples

Print message “Hello Everybody…” using programming practices and technique?

Required :

Input : Not RequiredQuality :Quantity :

Process : Not RequiredOutput : “Hello Everybody…”

Start

End

Display “Hello Everybody…”

Flowchart :

Dry Run :Hello Everybody…

Input 2 numbers from user and print their sum ?

Required :

Input :Quality : 2Quantity : Number

Process : a+boutput : Sum

Sum ← a+b

Start

Input “Enter first number :” → a

End

Input “Enter first number :” → a

Print “Sum is :”,Sum

Var a, b, Sum

Flowchart :

Dry Run :

a b Sum100 45 145

Input a numbers from user and check whether it is even or odd ?

Required :

Input :Quality : NumberQuantity : 1

Process : Modulus number by 2 and compare it by 0.

Output : Even or Odd

Flowchart :

Var num

Start

End

Ifnum%2==0

Input “Enter a number :” → num

Print “Even”

Print “Odd”

Dry Run :Enter a number :1414%2=0 (true)Even

Required :Input : Not Required

Quality :Quantity :

Process :output :

Recommended