Let’s learn about the algorithms and flowcharts in Programming today.
Computer programming is also known as programming. It is a process that actually leads from an original formulation of a computer problem to executable computer programs. Most important to know, a computer program is usually written by a computer programmer in a programming language itself. It is important because it defines the relationship, grammar and semantics which ultimately helps the programmer to communicate effectively with the machines that they program.
Algorithms and flowcharts are two different tools used for creating new programs. So, knowing both of them well in advance is a great idea to start programming easily.
An algorithm is a well-defined procedure that allows a computer to solve a problem. In computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning. Basically, it can be presented by natural languages, pseudo code and flowcharts, etc.
Characteristics of a Good Algorithm
Example 1: Print 1 to 10:
Algorithm:
Step 1: Initialize X as 0,
Step 2: Increment X by 1,
Step 3: Print X,
Step 4: If X is less than 10 then you need to repeat the step 2.
Example 2: Convert Temperature from Fahrenheit (℉) to Celsius (℃)
Algorithm:
Step 1: Read temperature in Fahrenheit,
Step 2: Calculate temperature with formula C=5/9* (F-32),
Step 3: Print C,
A schematic representation of a sequence of operations, as in a manufacturing process or computer program is known as a flowchart or we can say flowchart is a graphical representation of the sequence of operations in an information system or program.
Basic Characteristics of Flowchart
Types of Flowchart
There are four general types of a flowchart
Both algorithm and pseudocode are two different things. But, you can base your pseudocode on an algorithm that is the thing, They are used to plan out programs.
Example 1: Draw a flowchart to convert the length in feet to centinmeter.
Flowchart:
Here, Pseudocode is used.
Example 2: Draw a flowchart that will read the two sides of a rectangle and calculate its area.
Flowchart:
Here Pseudocode is used.
Q.1 |
Which symbol is used to indicate the flow of logic by connecting symbols. |
a) | Flow Line |
b) | Terminal |
c) | Input/Output |
d) | Processing |
Q.2 |
Which of the following is used for arithmetic operations and data manipulations? |
a) | Flow Line |
b) | Processing |
c) | Decision |
d) | On-Page |
Q.3 |
Which symbol is used to indicate stop/start of the program? |
a) | Terminal |
b) | Processing |
c) | Decision |
d) | Input/Output |
Q.4 |
How many types of flowcharts symbols are there? |
a) | 10 |
b) | 9 |
c) | 7 |
d) | 6 |
Q.5 |
int x=10; int y=20, what type of examples are these? |
a) | Relational |
b) | Binary |
c) | Logical |
d) | Assignment |
Q.6 |
What is the output of the following statement int x=10; x=x+2; |
a) | x'='8 |
b) | x'='10 |
c) | x'='12 |
d) | x'='2 |
Q.7 |
Which of the following is a flow line symbol? |
a) |
![]() a |
b) | ![]() b |
c) | ![]() c |
d) | ![]() d |
Q.8 |
Which of the following is a Terminal symbol? |
a) |
![]() a |
b) | ![]() b |
c) | ![]() c |
d) | ![]() d |
Q.9 |
Which of the following is a Manual Input symbol? |
a) |
![]() a |
b) | ![]() b |
c) | ![]() c |
d) | ![]() d |
Q.10 |
The output of the above flowchart is: ![]() |
a) |
Subtraction of Two Numbers |
b) | Addition of Two Numbers |
c) | Fibonacci |
d) | Factorial |
Your Score: 0/10