Assignment-4

divider
Question-1

Q1. Learn the meaning and application of function prototype, function call and function definition. Practice various return types such as void, int, float, char etc. using small programs.

Question-2

Q2. Practice 4 storage classes (auto, static, register and extern) to learn their scope, life, automatic initial value and storage location.

Question-3

Q3. WAP to swap two variables using with and without a temp variable using a function besides the main function.

Question-4

Q4. Find factorial.

Question-5

Q5. If a number is prime or not.

Question-6

Q6. Display first n prime numbers.

Question-7

Q7. HCF of two numbers using a separate function.

Question-8

Q8. LCM of two numbers using a function.

Question-9

Q9. Fibonacci series of n numbers using recursion.

Question-10

Q10. Add digits of an integer using a function.

Question-11

Q11. Find various problems that can be solved using recursion and which one is your favorite?

Question-12

Q12. What is a stack and what is its relation with recursion? Discuss with your lab teacher.

Question-13

Q13. Solve the game of Tower of Hanoi using recursion. Rules of this game are (i) move one disk at a time (ii) a bigger disk have to be always below.