Skip to main content
Chapter 4 of 11
NCERT Solutions

Introduction to Problem Solving — NCERT Solutions

CBSE · Class 11 · Computer Science

NCERT Solutions for Introduction to Problem Solving, CBSE Class 11 Computer Science: 17 textbook questions solved step by step. Covers Exercise.

45 questions92 flashcards5 formulas & key relations5 concepts

Interactive on Super Tutor

Studying Introduction to Problem Solving? Get the full interactive chapter.

Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for NCERT solutions and more.

Free trial, no card needed.

17 Questions Solved · 1 Section

The first 9 solutions are open to read. The other 8 are free with a Super Tutor account. Unlock all 17 free in Super Tutor

Exercise

1Write pseudocode that reads two numbers and divide one by another and display the quotient.Show solution
INPUT num1
INPUT num2
COMPUTE quotient = num1 / num2
PRINT quotient

Not sure why a step works? check your working in Super Tutor

2Two friends decide who gets the last slice of a cake by flipping a coin five times. The first person to win three flips wins the cake. An input of 1 means player 1 wins a flip, and a 2 means player 2 wins a flip. Design an algorithm to determine who takes the cake?Show solution

Let P1 and P2 store the number of wins of player 1 and player 2.

SET P1 = 0, P2 = 0
FOR i = 1 TO 5
    INPUT toss
    IF toss == 1 THEN
        P1 = P1 + 1
    ELSE
        P2 = P2 + 1
    ENDIF
    IF P1 == 3 THEN
        PRINT "Player 1 wins the cake"
        STOP
    ELSE IF P2 == 3 THEN
        PRINT "Player 2 wins the cake"
        STOP
    ENDIF
ENDFOR

Not sure why a step works? check your working in Super Tutor

3Write the pseudocode to print all multiples of 5 between 10 and 25 (including both 10 and 25).Show solution

Multiples of 5 between 10 and 25 are 10, 15, 20, 25.

SET num = 10
WHILE num <= 25 DO
    PRINT num
    num = num + 5
ENDWHILE

Not sure why a step works? check your working in Super Tutor

4Give an example of a loop that is to be executed a certain number of times.Show solution

An example is clap your hands five times.

FOR i = 1 TO 5
    CLAP
ENDFOR

Not sure why a step works? check your working in Super Tutor

5Suppose you are collecting money for something. You need ₹ 200 in all. You ask your parents, uncles and aunts as well as grandparents. Different people may give either ₹ 10, ₹ 20 or even ₹ 50. You will collect till the total becomes 200. Write the algorithm.Show solution

Use a running total and keep collecting until it reaches 200.

SET total = 0
WHILE total < 200 DO
    INPUT amount
    total = total + amount
ENDWHILE
PRINT total

Not sure why a step works? check your working in Super Tutor

6Write the pseudocode to print the bill depending upon the price and quantity of an item. Also printShow solution

From the chapter, the bill should be printed from price and quantity, and then Bill GST is the bill after adding 5% tax.

INPUT price
INPUT quantity
COMPUTE bill = price * quantity
PRINT bill
COMPUTE billGST = bill + (5/100) * bill
PRINT billGST

Not sure why a step works? check your working in Super Tutor

7Write pseudocode that will perform the following:

a) Read the marks of three subjects: Computer Science, Mathematics and Physics, out of 100
b) Calculate the aggregate marks
c) Calculate the percentage of marks

Show solution

Pseudocode:

INPUT CS
INPUT Math
INPUT Physics
COMPUTE Aggregate = CS + Math + Physics
COMPUTE Percentage = Aggregate / 3
PRINT Aggregate
PRINT Percentage

Not sure why a step works? check your working in Super Tutor

8Write an algorithm to find the greatest among two different numbers entered by the user.Show solution
INPUT num1
INPUT num2
IF num1 > num2 THEN
    PRINT num1
ELSE
    PRINT num2
ENDIF

Not sure why a step works? check your working in Super Tutor

9Write an algorithm that performs the following:

Ask a user to enter a number. If the number is between 5 and 15, write the word GREEN. If the number is between 15 and 25, write the word BLUE. if the number is between 25 and 35, write the word ORANGE. If it is any other number, write that ALL COLOURS ARE BEAUTIFUL.

Show solution

Algorithm:

  1. Input a number.
  2. If the number is between 5 and 15, print GREEN.
  3. Else if the number is between 15 and 25, print BLUE.
  4. Else if the number is between 25 and 35, print ORANGE.
  5. Else print ALL COLOURS ARE BEAUTIFUL.

Note: For boundary values like 15 and 25, the condition should be written carefully so that each number belongs to only one group.

Not sure why a step works? check your working in Super Tutor

10Write an algorithm that accepts four numbers as input and find the largest and smallest of them.

Free with a Super Tutor account

11Write an algorithm to display the total water bill charges of the month depending upon the number of units consumed by the customer as per the following criteria:
  • for the first 100 units @ 5 per unit
  • for next 150 units @ 10 per unit
  • more than 250 units @ 20 per unit

Also add meter charges of 75 per month to calculate the total water bill.

Free with a Super Tutor account

12What are conditionals? When they are required in a program?

Free with a Super Tutor account

13Match the pairs

Flowchart Symbol

Functions

Flow of Control

Process Step

Start/Stop of the Process

Data

Decision Making

Free with a Super Tutor account

14Following is an algorithm for going to school or college. Can you suggest improvements in this to include other options?

Reach_School_Algorithm

a) Wake up
b) Get ready
c) Take lunch box
d) Take bus
e) Get off the bus
f) Reach school or college

Free with a Super Tutor account

15Write a pseudocode to calculate the factorial of a number (Hint: Factorial of 5, written as 5!=5×4×3×2×1).

Free with a Super Tutor account

17Following is an algorithm to classify numbers as “Single Digit”, “Double Digit” or “Big”.

Classify_Numbers_Algo

INPUT Number

IF Number < 9

"Single Digit"

Else If Number < 99

"Double Digit"

Else

"Big"

Verify for (5, 9, 47, 99, 100 200) and correct the algorithm if required

Free with a Super Tutor account

18For some calculations, we want an algorithm that accepts only positive integers upto 100.

Accept_1to100_Algo

INPUT Number

IF (0<= Number) AND (Number <= 100)
ACCEPT

Else

REJECT
a) On what values will this algorithm fail?
b) Can you improve the algorithm?

Free with a Super Tutor account

8 more solved questions in Introduction to Problem Solving

They are free with a Super Tutor account, along with practice quizzes and flashcards for this chapter. Free to start, no card needed.

Frequently Asked Questions

What are the important topics in Introduction to Problem Solving for CBSE Class 11 Computer Science?
Key topics in Introduction to Problem Solving include Problem Solving Basics, Algorithm, Representation of Algorithms, Flowchart Symbols and Basic Examples. Study these first, then practise questions on each for Class 11 exams.
Are these NCERT Solutions for Introduction to Problem Solving free?
The first 9 of the 17 solutions on this page are open to read. The other 8 are free with a Super Tutor account — signing up is free and needs no card.
How should I revise Introduction to Problem Solving for Class 11 exams?
Learn the core ideas first, then work through the 45 practice questions on Introduction to Problem Solving. Revise definitions regularly and use flashcards for quick recall before the exam.

Sources & Official References

Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.

For serious students

Get the full Introduction to Problem Solving chapter — start free.

Quizzes, flashcards, an AI doubt solver and a study plan for CBSE Class 11 Computer Science. Free to start, no card needed.