BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION SP/2024)
CLASS: [Link]./ [Link]. SEMESTER : II
BRANCH: CSE/AIML/ECE/EEE/MATHS SESSION : SP/2024
SUBJECT: CS101 PROGRAMMING FOR PROBLEM SOLVING
TIME: 02 Hours FULL MARKS: 25
INSTRUCTIONS:
1. The question paper contains 5 questions each of 5 marks and total 25 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Tables/Data handbook/Graph paper etc., if applicable, will be supplied to the candidates
-----------------------------------------------------------------------------------------------------------------------------
CO BL
Q.1(a) List various responsibilities of an operating system. [2] 1 1
Q.1(b) Draw a block diagram of the computer system and explain its various components with [3] 1 2
special emphasis on storage.
Q.2(a) Define the term algorithm and explain the characteristics of a good algorithm. [2] 1 1,2
Q.2(b) Write a pseudocode and draw the corresponding flow chart where multiple conditions [3] 1 3
are checked to categorize a person based on specified age as either child (<12 years),
teenager (>=12 years but <19 years) or adult (>19 years).
Q.3(a) Compute the value of x and y for the following expressions with their evaluation tree: [2] 2 3
(i) x = !0 || 4.0 + 2.0 >= 3.0 – 2.0 (ii) y = 75 -20 – 48/8 * 5 + 9 % 2 + 10>>2
Q.3(b) Illustrate various programming errors in C with examples. [3] 3 2
Q.4(a) Illustrate the difference between prefix and postfix increment operator with [2] 2 4
examples.
Q.4(b) Differentiate between nested if-else and switch-case statement with examples. [3] 2 4
Q.5(a) Write a C program to evaluate the equation, sum = 1 + 1/2 + 1/3 + … + 1/n and display [2] 2 3
the sum to an accuracy of four decimal places.
Q.5(b) How is the size of an initialized array A [ ] = {1, 2, 3, 4 ,5} computed? Write a program [3] 2 3
in C to compute and display average and sum of squares of an array of real data
supplied by the user.
::::::26/02/2024::::::E