FLOW CHART
Flow char is a graphical(pictorial) representation of algorithm. It is used to represent algorithm steps into graphical format. It also gives us an idea to organize the sequence of steps or events necessary to solve a problem with the computer. In other words flow charts are symbolic diagrams of operations and the sequence, data flow, control flow and processing logic in information processing. These charts are used to understand any working sequence of the program.
What are the Advantages(uses) of FLOW CHART?
Ans:
Advantages of flowchart:-
1. It provides an easy way of communication because any other person besides the programmer can understand the way they are represented.
2. It represents the data flow.
3. It provides a clear overview of the entire program and problem and solution.
4. It checks the accuracy in logic flow.
5. It documents the steps followed in an algorithm.
6. It provides the facility for coding.
7. It provides the way of modification of running program.
8. They shows all major elements and their relationship.
erere
Terminator
This symbol represents the beginning and end point in a program. We use start and stop option in it.
Input/Output Symbol
This symbol is used to take any input or output in the algorithm.
Process Symbol
A rectangle indicates the processing, calculation and arithmetic operations
Decision Symbol
It is used when we want to take any decision in the program.
Connector Symbol
This symbol is used to connect the various portion of a flow chart. This is normally used when the flow chart is split between two pages
Data Flow Symbol
This symbol is used to display the flow of the program. It shows the path of logic flow in a program.
1. Write a c program to display "this is my first c program" on monitor
ans:
ALGORITHM
1. START
2. use the printf() function to print the message "this is my first c program".
3. use getch() function to see the output
4. STOP
FLOW CHART
2. Write a c program to find the area of a triangle for the given three sides
ans:
Algorithm:
1. START
2. declare the floating variables a,b,c,s,area.
3. use the print() to print the message "enter three sides"
4. use the scanf() to read the values of sides from keyboard
5. write the logic for s. s=a+b+c/2
6. write the logic for area=root of (s(s-a)(s-b)(s-c)
7. use the printf() to print the area.
8. STOP
Flow chart
3. WAP to find whether a given year is leap or not?
1. START
2. declare year of type integer.
3. use the print() to print the message "enter the year"
4. use the scanf() to read the year from keyboard
5. check the following condition with if..else statement
(year%4==0&&year%100!=0 || year%400==0)
(if an year is divisible by 4 AND not divisible by 100, OR is divisible by 400 then it is called Leap Year
6. if the above condition is TRUE then Print "leap year"
7. if the above condition is FALSE then Print "not a leap year".
8. STOP
To Determin the given number is positive, negative or zero
to find sum of first number
Algorithm to find the sum of first n natural numbers:
1. Read n.
2. Initialize a=1.
3. Initialize sum s=0.
4. Calculate s=s+a.
5. Calculate a=a+1.
6. if a>n, then goto step 7 else goto step 4.
7. Write the sum s.
8. Stop.
Draw a flowchart to find the largest of three numbers A, B, and C.
Example:
1. flow chart for to print the *'s in the following format
2. flow chart for fibonnacci series Flowchart
Flow chart for To find the roots of the quadratic equation
Files
Data structures
download raptor software to draw flowchart
No comments:
Post a Comment