MU First Year Engineering (Semester 2)
Structured Programming Approach
December 2013
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


1 (a) What do you mean by an algorithm? Which steps should you consider while developing one?
4 M
1 (b) Find the roots of a quadratic equation. Is the above problem definition complete? If not, make the problem definition complete.
4 M
1 (c) State any two functions in math.h along with their uses.
4 M
1 (d) What do you mean by static and auto storage class? Explain.
4 M
1 (e) What are the differences between the while and do..while loops?
4 M

2 (a) Write a program in C to cyclically rotate (left or right according to the user s choice) the elements in an array. If array a contains {1,2,3,4,5} and choice is right rotate, output should be {5,1,2,3,4}. If choice is left rotate, output should be {2,3,4,5,1}}.
10 M
2 (b) Write a program to generate prime numbers between 1 and 100.
10 M

3 (a) What do you mean by recursion? Write a program that accepts two numbers, say x and y, and calculate xy. Program should make use of recursion. If x is 3 and y is 4, then output should be 34 i.e. 81.
10 M
3 (b) Write a program to sort given numbers in descending order.
10 M

4 (a) What do you mean by a struct? What do you mean by a nested struct? A sports club wants to maintain data of its players, including name, age, no. of matches played, no. of runs, and average. For this, make a structure and comment about the size of the structure of your declaration.
10 M
4 (b) Write a program which will accept 2 dimensional square matrix and find out the transpose of it. Program shouldn't make use of another matrix.
10 M

5 (a) Write a program to generate the following patterns.
10 M
5 (b) Write a program to check whether given string is a Palindrome or not.
10 M

6 (a) What are the different ways of parameter passing to a function? Explain with example.
10 M
6 (b) What do you mean by FILE? What are the different functions available to read data from the file? Specify the different modes in which files can be opened along with their syntax.
10 M



More question papers from Structured Programming Approach
SPONSORED ADVERTISEMENTS