Algorithm to check if a number is even or odd:
- Start
- Input a number N
- If N mod 2 = 0 (i.e., N is divisible by 2 with no remainder), then
- Print “The number is even.”
- Else
- Print “The number is odd.”
- End
This algorithm first checks if the number is divisible by 2. If it is, the number is even; otherwise, it is odd.
Related Questions:
- Describe the steps involved in problem-solving.
- Calculate the area of a rectangle for a given breadth and length
- Write an algorithm that inputs length in inches and calculates and prints it in centimeters.
- Write an algorithm to find the sum of the given sequence. SUM = 20 + 25 + 30 + 35 + 40 + 45 + 50 + 55 + 60
- Write an algorithm to find the product of the given numbers. PRODUCT = 1 × 3 × 5 × 7 × 9 × 11 × 13 × 15
- Write an algorithm to print the multiplication table of a number in reverse order.
- Convert the algorithms of questions 4 to 9 into flowcharts.
- Explain the differences between an algorithm and a flowchart with examples.
- Define computer.
- What is an algorithm and what is the role of an algorithm in problem-solving?
- What is a flowchart?
- Draw any four graphical symbols used in a flowchart and explain them.
- What is the role of loops in programming?
- Differentiate between sequence, selection, and iteration in programming.
- Why is problem analysis important in programming?
- How does an algorithm help in efficient problem-solving?
- Explain the importance of using flowcharts before writing a program.
- Show memory hierarchy with the help of a diagram.
- Write four properties of computational thinking.
- Model Papers (1-10)