DAV Institute of Engineering & Technology, Jalandhar MST 2nd (ME 2nd SEM) FCPIT (BTCS-101) Max.

Marks: 30 Time allowed: 1:30 hrs

Instructions: Section A is compulsory. Attempt any two questions from section B .

Section A Q1
a) b) c) d) e)

Distinguish between while loop and do while loop? Write a program to reverse the digits of a number? Why do we need default arguments of the function? Discuss various string library functions available in c++? What are storage classes? Justify 5 * 2 = 10

Section B
Q2 a) Explain with example the concept of call by value and call by reference? (5) b) Write a program in c++ to find the sum of the elements of fibonacci series of ten numbers with 0 and 1 as initial elements. (5)

Q3. (a) What are arrays and how they are initialized? Why do we need arrays? (5) (b)Take an array of 10 numbers. Write a program which read an array and make a function in the program which sorts the elements of array in increasing order and also print the elements of array. (5) Q4. a) Define recursion? Find the factorial of the number using recursion. (7, 3)

b) What are three main components of a function? Explain by using suitable example.


Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

Master Your Semester with a Special Offer from Scribd & The New York Times