1. Write an algorithm and draw a flowchart to print whether a number is even or odd.
Answers
Answer:
Algorithm : a
Step 1 : Start
Start 2 : Read n
Start 3 : if (n%2 == 0), Write " even number" else Write " odd number"
Start 4 : Stop,
Example 1 : Input : 15
Output : odd number
Example 2 : Input : 12
Output : even number
Explanation about Algorithm:
What is Algorithm explain?
An algorithm is a set of instructions designed to perform a specific task. This can be a simple process, such as multiplying two numbers, or a complex operation, such as playing a compressed video file. ... In computer programming, algorithms are often created as functions.
What is an algorithm example?
A Real Life Algorithm
One of the most obvious examples of an algorithm is a recipe. It's a finite list of instructions used to perform a task. For example, if you were to follow the algorithm to create brownies from a box mix, you would follow the three to five step process written on the back of the box.
What is algorithm and its types?
An algorithm is a set of self contained sequence of instructions or actions that contains finite space or sequence and that will give us a result to a specific problem in a finite amount of time. It is a logical and mathematical approach to solve or crack a problem using any possible method.