Past Papers Notes Generator Questions

Functions and Recursion Questions
AIPC 101 - AI Programming Concepts Past Papers

Practice 35 past-paper questions for Functions and Recursion in AIPC 101 - AI Programming Concepts. Get solutions and exam preparation resources.

Click on a question to view the full answer

1. What is recursion? Provide an example of a recursive function to calculate the factorial of a number.
View
2. What is tail recursion? Provide an example in Python.
View
3. What is memoization? Provide an example.
View
4. What is a function in python programming? Explain the syntax for declaring function, calling a function and passing para…
View
5. What is recursion? Write a program to demonstrate the working mechanism of recursive function.
View
6. A computer program that converts an entire program into machine language is called a/an
View
7. Explain different categories of Computer in detail.
View
8. Write about different parts of a function definition. What is the importance of function declaration?
View
9. Write a program which can perform basic operation of a calculator (addition, subtraction, multiplication and division) b…
View
10. Differentiate between arguments pass by value and pass by reference with appropriate examples.
View
11. What is recursion? What are the components for a valid recursive definition? Explain in brief.
View
12. What is the correct format for a function prototype?
View
13. What is the output of the given program?
View
14. What is the output of the following code? ```c #include <stdio.h> void make_triple(int x){ x = x * 3; } void main(vo…
View
15. Consider the weekly salary of a salesman who is selling some domestic products. If x is the number of products sold in a…
View
16. Write a C++ program to convert inch into centimeter.
View
17. Write a program that illustrates the concept of operator overloading.
View
18. When do we use the concept of function overloading and constructor overloading? Illustrate with example.
View
19. What is function overloading?
View
20. ### 2. What is function overloading in C++? Provide a full step-by-step solution.
View
21. Write a program implementing function template which returns greatest among three numbers. Pass the arguments as referen…
View
22. 3. What will be the output of the following code? def ktm(): print (‘Kathmandu’) ktm() ktm()
View
23. 13. A(n) is a piece of data that is sent into a function. [ ] argument [ ] parameter [ ] variable [ ] recursion
View
24. 17. What is the output of this code: def add(x, y): return x + Yy print(add(3, 4))
View
25. 19. Which of the following statements is FALSE about recursion? [ ] Every recursive function must have a base case [ ] I…
View
26. Write a Python program to generate the given pattern using for loops. * * % * ¥ % * %k ¥ ok * ok %k %
View
27. Explain the concept of a module in Python functions. How do you include the module functionality in python?
View
28. Illustrate with an example the concept of list comprehension in Python.
View
29. Compare and contrast lists with dictionaries in terms of data organization and retrieval.
View
30. Discuss the working principle of a function that calculates the factorial of a number using recursion.
View
31. Describe the different ways to pass arguments to a function. Provide examples for each.
View
32. 6. Explain the rules and conventions for naming variables in Python. Provide examples of valid and invalid variable name…
View
33. Define recursive function. Write a program in Python to input number and calculate the sum of individual digits using re…
View
34. What is function? Write its type and how to declare the user defined function in Python? Write a program in python that…
View
35. Which keyword is used for function?
View
Sponsor Space