Pages

Monday, October 14, 2013

Programming Language, CSE First semester examination 2011



B.Sc (HONS.) IN CSE1, FIRST SEMESTER EXAMINATION, 2011
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 is a variable and “value” of a variable?
(b) Describe the four basic data types. Write the purpose of the qualifiers const and voltaic.
(c) Which of the following are on valid variable names and why:-

(1) Doubles
(2) Minimum
(3) Row   total
(4) 3rd –row
(5) Name
(d) Write a program in C to calculate the area and circumference of a circle.
2. (a) What are the different types of operators used in C program? With example explain about logical operators and bitwise operators.
 (b) Why we need to use # include <math.h> and # include <ctype.h> statement in C program?
(c) In what ways does a switch statement differ from an if statement?
(d) Write down the general form and flowchart of IF, IF-ELSE and nested IF-ELSE statement.
(e) Write a C program to find the number of and sum of all integers greater than 50 and less than 300 that are divisible by 9.
3. (a) Is it a good approach to use “goto” statement? Explain your opinion.
(b) In What ways does “Switch break” statement differ from “If Else if Else” statement?
(c) Write a program in C to determine whether a number a is prime or not.
(d) The number in a sequence 1 1 2 3 5 8 13 21…………….are called Fibonacci numbers.  Write a C program using a for loop to calculate and print the first 20 Fibonacci numbers. Write a C program using a for loop to calculate and print the first 20 Fibonacci number.
4. (a) what is an array? Define a two –dimensional integer array and input data values of 4 rows and 5 columns each.
(b) Write a program to extract a portion of a character string and print the extracted string. Assume that m characters are extracted, starting with nth character.
(c) What are different types of string handling function? Write a program to test whether the given input string is palindrome or not.
(d) Describe the limitations of using get char ( ) scarf (  ) for Reading strings.
5. (a) What is a function definition? Write down the general form of function definition.
(b) Distinguish between the following –
  (1) Actual and formal parameter;
  (2) Automatic and static variables.
(c) Create a structure which will store name, roll no. and marks of 6 courses that you obtained. This structure will also store total obtained marks. Store all the data for 10 students. Write a program in C to record student’s information according to their merit position.
(d) What do you mean by “call by value” and “Call by reference” ?
6. (a) Describe the different types of file opening mode.
(b) Describe about the error handling in file operation.
(c) Using the following declarations-
Int   x = 10, y=10;
Int *p1-qx, p2 = qy;
Determine the value of each of the following expression-
(1) (*p1) ++
(2) *p1 +(*p2 )—
(3) - - (*p2)
(4) ++(*p2) -*p1
(d) A file named DATA contains some integer number. Write a file program which will produce all odd numbers in a file named ODD and all even numbers in a file EVEN.

0 comments:

Post a Comment