22
Flowchart’s Nitin Chandwani

Programming flowcharts for C Language

Embed Size (px)

DESCRIPTION

Programming flowcharts for C Language

Citation preview

Page 1: Programming flowcharts for C Language

Flowchart’s

Nitin Chandwani

Page 2: Programming flowcharts for C Language

• 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.

Page 3: Programming flowcharts for C Language

• 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.

Page 4: Programming flowcharts for C Language

Symbols of Flowcharts

Page 5: Programming flowcharts for C Language

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.

Page 6: Programming flowcharts for C Language

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.

Page 7: Programming flowcharts for C Language

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.

Page 8: Programming flowcharts for C Language

6. Connector Symbol :

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

A

Page 9: Programming flowcharts for C Language

Steps for Programming Practices and Techniques

Page 10: Programming flowcharts for C Language

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.

Page 11: Programming flowcharts for C Language

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.

Page 12: Programming flowcharts for C Language

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.

Page 13: Programming flowcharts for C Language

Examples

Page 14: Programming flowcharts for C Language

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

Required :

Input : Not RequiredQuality :Quantity :

Process : Not RequiredOutput : “Hello Everybody…”

Page 15: Programming flowcharts for C Language

Start

End

Display “Hello Everybody…”

Flowchart :

Dry Run :Hello Everybody…

Page 16: Programming flowcharts for C Language

Input 2 numbers from user and print their sum ?

Required :

Input :Quality : 2Quantity : Number

Process : a+boutput : Sum

Page 17: Programming flowcharts for C Language

Sum ← a+b

Start

Input “Enter first number :” → a

End

Input “Enter first number :” → a

Print “Sum is :”,Sum

Var a, b, Sum

Flowchart :

Page 18: Programming flowcharts for C Language

Dry Run :

a b Sum100 45 145

Page 19: Programming flowcharts for C Language

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

Page 20: Programming flowcharts for C Language

Flowchart :

Var num

Start

End

Ifnum%2==0

Input “Enter a number :” → num

Print “Even”

Print “Odd”

Page 21: Programming flowcharts for C Language

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

Page 22: Programming flowcharts for C Language

Required :Input : Not Required

Quality :Quantity :

Process :output :