CBSE CS and IP

CBSE Class 11 & 12 Computer Science and Informatics Practices Python Materials, Video Lecture

Recursion (3 Marks Questions)


  1. Write a program to reverse the string using recursion.
    OR
    Write a recursive function that could print a string backward.

  2. Write a program to show the use of recursion in the calculation of exponentiation e.g. ab.

  3. Write the output of the following program?
    sum=0
    def recur(p):
        if p<=0:
            return 1
        else:
            return (recur(p-2) + recur(p-1))
    print(recur(5))
    

  4. Write a program to print Fibonacci Series up to Nth Term using Recursion?
  5. Write the program of binary search Using Recursion?
  6. Write a recursive function that computes the sum of number 1…...n ; get the value of last number n from the user.

No comments:

Post a Comment