Pages

Monday, October 14, 2013

Programming Language, CSE First semester examination, 2010



B.Sc (HONS.) IN CSE1, FIRST SEMESTER EXAMINATION, 2010
CSE-112
(Programming Language)
Time -3hours
Full mark-80
[N.B.-the figure in the right margin indicate full mark. Answer any four questions. Proper sequence of answer must be maintained.]
1. (a) What do you mean by variable? How can you declare and initialize a variable using C program?
(b) Write a C program to calculate the area and perimeter of a triangle.
(c) Write down the steps of executing a C program. What are the different forms of main statements C permits?

(d) Describe the purpose of # define and # include directive. Why shouldn’t these directives end with a semicolon?
2. (a) Write down the syntax of structure and union. State the difference between them.
(b) What is pointer? Declare and initialize a pointer variable.
(c) Define recursion. Write a program that will calculate the factorial of a given number using recursion function.
(d) State the name of the different storage class specifies. Write down the scope and lifetime of each of them.
3. (a) What is an array? Suppose an array A contain 14 elements as follows: -
   A: 66; 33; 40; 22; 55; 88; 60, 11, 80, 20, 50, 44, 77, 30,
Sort the array A using Merge sort algorithm (show step by step procedure).
(b) What are the difference between break and continue statement?
(c) Write a program to compute and print a multiplication table for numbers 1 to 5.
(d) How can an array be explicitly initialized at run time? What is the purpose a memory management functions malloc and calloc?
 4. (a) Write down the general form and flowchart of switch statement.
(b) State De-Morgan’s rule. Write a program to evaluate the equation.
(c) What are counter controlled loops and sentinel controlled loops?
(d) Write a C program to compute the roofs of a quadratic equation   + bx + c= o [Use the following conditions]
        i.            There is only one root, if a=0 (x – c/b);
     ii.            There are no real roots, if  -4ac is negative;
   iii.            Otherwise, there are two real roots.
5. (a) write down the general form of a scarf statement. What are the advantages of using symbolic constants?
(b) Write a program that will convert the given temperature in Fahrenheit to Celsius using the following formula:
C= (F-32)/1.8
(d) What is the need for user defined functions? Define the character array to store the word ‘HELLO’!
6. (a) What is the associability property of an operator? Write a program that will obtain the length and width of a rectangle from the user and compute its area and perimeter.  
(b) Describe explicit conversion briefly.
(c) What is the effect of the following specifications in printing a string “New Market 110001’, containing 17 characters?
(d) Write a C program using file management where you are input a series of integer number which will generate a file called EVEN to store all even and file called ODD to store all odd numbers.

0 comments:

Post a Comment