C Programming • Introduction to Computer, Programming & algorithms
C Programming / Flowchart — Exercises

Flowchart — Exercises

Practical 1 Introduction to Computer, Programming & algorithms

Draw a flowchart to add two numbers.

Practical / Solution

Flowchart — Exercise 1

Problem

Draw a flowchart to add two numbers.

Flowchart

Flowchart to add two numbers

Explanation

The flowchart starts by taking two numbers as input, adds them, displays the sum, and then stops.

Flowchart — Exercise 2

Problem

Draw a flowchart to find the largest of two numbers.

Flowchart

Flowchart to find the largest of two numbers

Explanation

The flowchart accepts two numbers, compares them, and displays the greater number.

Flowchart — Exercise 3

Problem

Draw a flowchart to calculate the area of a rectangle.

Flowchart

Flowchart to calculate area of a rectangle

Explanation

The flowchart takes the length and width as input, calculates the area using length × width, displays the result, and stops.

Flowchart — Exercise 4

Problem

Draw a flowchart to calculate simple interest.

Flowchart

Flowchart to calculate simple interest

Explanation

The flowchart accepts the principal amount, rate and time, applies the simple interest formula, displays the result, and stops.

Flowchart — Exercise 5

Problem

Draw a flowchart to check whether a number is even or odd.

Flowchart

Flowchart to check whether a number is even or odd

Explanation

The flowchart divides the number by 2 and checks the remainder. A remainder of 0 indicates an even number; otherwise the number is odd.

Flowchart — Exercise 6

Problem

Draw a flowchart to check whether a number is positive, negative, or zero.

Flowchart

Flowchart to check positive negative or zero

Explanation

The flowchart compares the input number with zero and determines whether it is positive, negative, or zero.

Flowchart — Exercise 7

Problem

Draw a flowchart to find the largest of three numbers.

Flowchart

Flowchart to find the largest of three numbers

Explanation

The flowchart compares the three input values and determines which one is the largest.

Flowchart — Exercise 8

Problem

Draw a flowchart to calculate the factorial of a number.

Flowchart

Flowchart to calculate factorial

Explanation

The flowchart initializes the factorial value, repeatedly multiplies it by the numbers from 1 to N, and displays the result.

Flowchart — Exercise 9

Problem

Draw a flowchart to reverse a given number.

Flowchart

Flowchart to reverse a number

Explanation

The flowchart repeatedly extracts the last digit of the number and constructs the reversed number until the original number becomes zero.

Flowchart — Exercise 10

Problem

Draw a flowchart to find the sum of the first N natural numbers.

Flowchart

Flowchart to find sum of first N natural numbers

Explanation

The flowchart starts with SUM = 0 and repeatedly adds the natural numbers from 1 to N. The final sum is then displayed.