Pps
Pps
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
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(END SEMESTER EXAMINATION)
CLASS: B.TECH./ I.MSC. SEMESTER : II
BRANCH: CSE/AIML/ECE/EEE/MATHS SESSION : SP/2024
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
CO BL
Q.1(a) Write an algorithm and draw the corresponding flow chart to display the total [5] 1 3
electricity bill charges of the month depending upon the number of units consumed
by the customer as per the following criteria:
• for the first 100 units @ Rs. 5 per unit
• for next 150 units @ Rs. 10 per unit
• more than 250 units @ Rs. 20 per unit
Also add meter charges of Rs. 75 per month to calculate the total electricity bill.
Q.1(b) Illustrate different categories of data types and operators in C with examples. [5] 2 1,2
Q.2(a) Explain different categories of loops and their applications in C with examples. [5] 2 2
Q.2(b) Write a program to compute the square root of a series of numbers and display the [5] 3 3
results with a total count of negative numbers (if any). The program stops when the
number 9999 is typed in. In case, the series contains any negative numbers, the
process of evaluation of square root should be bypassed for such numbers.
Q.3(a) Write a C program that inputs a polynomial p(x) of maximum degree 3 by reading its [5] 4 3
coefficients in an array and then evaluates the polynomial at various values of x.
Also print this polynomial.
Q.3(b) Illustrate the bubble sort technique for sorting an array with its implementation. [5] 2 1,2,3
Q.4(a) Differentiate between the call by value and call by reference with suitable program [5] 2 4
segments.
Q.4(b) Specify the characteristics for problems that lend themselves to a recursive [5] 5 1,2,3
solution. Write a recursive function that take n (n>0) words as input and print them
in reverse order on separate lines and explain its working with an example.
Q.5(a) Why do we require a self-referential structure? Explain. Write a program to create a [5] 3 2,3
linear linked list interactively and print out the list and the total number of items in
the list.
Q.5(b) Write a program to open a file named INVENTORY which is received as command [5] 3 3
line argument and store in it the following data:
Item name Item number Price Quantity
AAA-1 111 18.00 115
BBB-2 125 36.00 75
CCC-3 247 32.00 104
Extend the program to read this data from the file INVENTORY and display the
inventory table with the value of each item.
:::::29/04/2024:::::E
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(END SEMESTER EXAMINATION)
CLASS: BTECH/IMSC SEMESTER: First
BRANCH: BT/CIVIL/CHEMICAL/MECH/PIE/FT/PHYSICS SESSION: MO/2023
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
CO BL
Q.1(a) Solve the following equation using a flowchart and algorithm [5] CO1 3,4
AX2 + BX +C=0
Q.1(b) What do you by algorithm? Explain briefly about properties of the algorithm [5] CO1 2
Q.2(a) Find the output of the following fragment of code given in C language [1X5] CO2 4
a) for ( int x = 2 ; x <= 6 ; x++ )
{
if ( x > 4 )
break ;
printf( "%d" , x ) ;
}
}
b) int num =10;
int a;
a=num++;
printf("num is %d, a is %d",num,a);
c)
int num =10;
while (num++<=15)
{
if (num ==14)
continue;
printf("%d",num);
}
d)
int a= 2*((8%5)*(4+(15-3)/(4+2)));
printf("%d",a);
e)
int num =10;
int a=6;
a=num--*6;
printf("num is %d, a is %d",num,a);
Q.2(b) Explain the following with the help of an example [5] CO2 2,3
a) Implicit and explicit type conversion
b) Comparison between while and do while loop
Q.3(a) Explain the following with the help of an example [5] CO3 2,3
1) Array ( Single and Multiple Dimension)
2) strings related built-in functions (any two)
PTO
Q.3(b) a) Store and display the following numbers in a matrix of order 3 X4 using a 2D [5] CO3 3
array.
10 20 30 40
15 25 35 45
5 15 25 35
Q.4(a) Explain briefly about the bubble sort algorithm or program. [5] CO5 3,4
Sort the following numbers using the bubble sort algorithm
15, 10, 5, 3, 20, 16, 12, 9
Q.4(b) Write a program in C language to solve the factorial of a number using recursive and [5] CO5 3,4
non-recursive functions.
Q.5(a) What do you mean by structure? How do you access structure members? Create the [5] CO4 3
following using the structure.
Q.5(b) What do you mean by a pointer? How do you declare a pointer and assign an address [5] CO4 3
to a pointer? Explain briefly about the relation between array and pointer with the
help of an example.
:::::14/12/2023 M:::::
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION MO23)
CLASS: BTECH / IMSC SEMESTER : I
BRANCH: BT/CIVIL/CHEMICAL/MECH/PIE/FT/PHYSICS SESSION : MO2023
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) Explain any two examples of each of the following operators. [2] 2 BL1
a) Arithmetic operators
b) Logical operators
Q.1(b) Explain briefly about each line of code in the following program. [3] 1 BL2
#include<stdio.h>
void main()
{
int a=10;
float b= 23.56;
char c=’A’;
printf(“%d %f %c\n”,a,b,c);
}
Q.2(a) Make a flow chart to find out whether a number is an odd number or even number, if [2] 1 BL2
any integer number is input through keyboard.
Q.2(b) Write all steps to solve expression involving integer values only which is based on [3] 2 BL2
precedence and associativity concept.
5*(10/5+ (7*6-3)% ( 6+5-2))
Q.3(a) Write any four common flowchart symbols along with their meaning. [2] 1 BL1
Q.3(b) Write a program to calculate the sum of the digits of a 3-digit input number. [3] 2 BL3
}
}
Q.4(b) Write a program to determine whether an entered character is a vowel or not using [3] 2 BL2
switch case statement.
Q.5(a) Write the equivalent code using while loop in place of for loop [2] 2 BL2
int i, sum=0;;
for(i=1; i<=5; i++)
{
sum=sum+i;
}
Q5(b) Write an interactive program that will read in a positive integer value and [3] 2 BL2
determine whether the integer is a prime number or not.
Example: 2, 3, 5, 7, 11 are prime numbers.
:::::16/10/2023:::::
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(END SEMESTER EXAMINATION)
CLASS: B.TECH / IMSC SEMESTER: II
BRANCH: CSE/AIML/ECE/EEE /MATHS SESSION: SP/2023
SUBJECT: CS101 PROGRAMMING FOR PROBLEM SOLVING
TIME: 3 Hrs FULL MARKS: 50
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
-------------------------------------------------------------------------------------------------------------------------------------------
Marks CO BL
Q.1 Explain the following (any five): 1,2,4 3,4,5
a) Given x=4, y=20 and z=5, evaluate the value of the following arithmetic [5x2=10]
expressions: x * y / z + ( x * z + y )
b) WAP to check if a number is even or odd using bitwise operators.
c) Write an algorithm to find distance between two points.
d) Given a= 10, b=5 and c=6, evaluate the following logical expression:
d= ((a < b) & & (b > c)) | | (a > c)
e) Write a pseudocode to delete all duplicate elements from array.
f) Write a program to find the largest of three numbers using ternary
operators.
g) Explain briefly about post increment and decrement and prefix increment
and decrement with the help of program.
Q.2(a) (I) What is the difference between conditional structure, branching structure [2+3=5] 3 3,4
and looping structure?
(II) Write a program to convert a month name to a number of days.
Expected Output:
List of months: January, February, March, April, May, June, July, August,
September, October, November, December
Input the name of Month: February
No. of days: 28/29 days
Q.2(b) (I) Write a C program to find prime factor of a number. If a factor of a [2.5+2.5= 3,5 4,5,6
number is prime number then it is its prime factor. 5]
T T F T T F T F T
Q.4(a) (I) Can recursion be used to solve all iterative programs and vice versa? If [2x2.5=5] 3 3,4,5
you answered no, explain why; if you answered yes, explain the differences
between iterative and recursive programs.
Median: takes an int array and the array's size as arguments. It should return
the median value of the array elements, as a double. If the values are sorted,
the median is the middle value. If the set contains an even number of values,
the median is the average of the two middle values. Assume the values in the
array is already sorted. Do not use square brackets anywhere in the function,
not even the parameter list (use pointers instead).
Testing Median
Case 1
Input: 1 2 3 4 5 6 7 8 9
Output: 5
Case 2
Input: 1 2 3 4 5 6 7 8
Output: 4.5
Q.5(a) What do you mean by structure? How do you declare self-referential [1+1+3=5] 5 1
structure? Explain call by reference with the help of program.
Q.5(b) What do you mean by opening a data file? [1+1+3=5] 5 2
What is the primary advantage to using a data file?
Write a program to copy the content of one into another file using file
concept.
:::::21/07/2023:::::
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION SP2023)
CLASS: B. TECH / IMSC. SEMESTER: II
BRANCH: CSE/AI&ML/ECE/EEE/MATHS & COMP. SESSION: SP/2023
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) Compare Pseudocode with an algorithm for the Program Factorial of a Number. [2] CO2 BL4
Q.1(b) Write a C program to convert a decimal number into an equivalent binary number [3] CO1, BL3
using bitwise operators. C04
Q.2(a) Amicable numbers are found in pairs. A given pair of numbers is Amicable if the [2] CO1, BL3,
sum of the proper divisors (not including itself) of one number is equal to the other CO4 BL4
number and vice–versa.
For example, 220 &284 are amicable numbers.
First, we find the proper divisors of 220:
220:1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110
1+ 2 + 4 + 5 + 10 + 11 + 20 + 22 + 44 + 55 + 110 = 284
Now, 284: 1, 2, 4, 71, 142
1 + 2 + 4 + 71 + 142 = 220
(II) Given a= 10, b=5 and c=6, evaluate the following logical expression:
d= ((a < b) & & (b > c)) | | (a > c)
Q.3(a) How many lines of output does the following ‘C’ code produce? [2] CO3 BL4
#include<stdio.h>
float i=2.0;
float j=1.0;
float sum = 0.0;
main ()
{
while (i/j > 0.001)
{
j+=j;
sum=sum+(i/j);
printf("%f\n", sum);
}
}
Q.3(b) Write a program in C to check whether a number can be expressed as the sum of [3] CO1, BL3,
two prime. CO4 BL4
Test Data: CO5
Input a positive integer: 16
Expected Output:
16=1+15 // both are not prime
16=2+14 //2 is prime but 14 is not
16 = 3 + 13 // both are prime (ANS.)
16=4+12 //both are not prime
16 = 5 + 11 // both are prime (ANS.)
16=6+10 // both are not prime
16=7+9 // 7 is prime but 9 is not
PTO
Q.4(a) Write a C program to implement password registration, that accepts a string as [2] CO4, BL3,
password if it is at least 8 characters in length, has at least one capital letter, small CO5 BL4,
letter, digit, and a special character. BL6
Q.4(b) Write a C program to search a name in a list using binary search techniques. [3] CO5 BL3,
BL4
Q.5(a) Find the total number of swaps that take place when sorting the following set of [2] CO4 BL4
numbers using bubble sort. Show the passes in individual steps.
Location 1 2 3 4 5 6
Elements 33 77 46 99 12 56
For example, if the positions of 33 and 12 are interchanged, it is called one swap.
::::::30/05/2023::::::M
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(END SEMESTER EXAMINATION)
CLASS: BTECH/IMSC SEMESTER :1st
BRANCH: BT/CHEMICAL/CIVIL/MECH/PIE/FT SESSION : MO/2022
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
CO BL
Q.1(a) Describe any four basic data types in C. [5] CO1 2
Q.1(b) Explain typecasting with an example. [5] CO1 2
Q.2(a) Write a program in C to take an integer number as user input and check if it is a [5] CO2,3 2
palindrome or not.
Q.2(b) Write a program to print the following pattern: [5] CO2,3 2
1
12
123
1234
12345
::::::16/03/2023::::::M
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION)
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
Q1 (a) What is the difference between a keyword and an identifier? [2] 1 1
Q1 (b) Explain the features of different types of storage classes of a variable. [3] 1 2
Q4 (a) Given a= 10, b=5 and c=6, evaluate the following logical expression: [2] 2 5
d= ((a < b) & & (b > c)) | | (a > c)
Q4 (b) Write a C program to input a number from the user in a loop till the user enters -1 and [3] 2 1
count how many numbers inputted are positive, negative and zero valued.
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
Q.1(a) Explain how CPU, memory and input/output devices perform when a program is given as input through [5]
keyboard.
Q.1(b) What do you mean by algorithm of a program? Write an algorithm to add n integer numbers. [5]
Q.2(a) What do you mean by precedence and associativity? Compute the output of the following arithmetic [5]
expression:
4*((8/5)+(7*(5-3))%(8+5-2))
Q.2(b) Discuss Logical operators and bitwise operators with examples. Explain postfix and prefix operator [5]
with the help of a suitable program.
Q.3(a) What do you mean by an array? Write the disadvantages of using array. How character strings are [5]
defined in C? Write a program to search a character from a character array.
Q.3(b) Write a program to add two matrices, store it into a third matrix and print it. [5]
Q.4(a) What do you mean by recursion? Write and explain a program to compute the factorial of a number [5]
using recursion.
Q.4(b) How arrays can be passed to functions? Explain. Write a program that use a function to accept an [5]
array of real elements and compute the largest value in this array of elements.
Q.5(a) What do you mean by array of structures? Write a program that use a structure named “marks” [5]
comprising of four integer members, subject1, subject2, subject3 and total, and compute the subject-
wise and student-wise totals and store them as part of the structure.
Q.5(b) What are the different modes in which you can open a file in C? A file named “DATA” contains a series [5]
of integer numbers. Write a program to read these numbers and then write all ‘odd’ numbers to a file
to be called ODD and all ‘even’ numbers to a file to be called EVEN.
:::::22/07/2022:::::
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION)
INSTRUCTIONS:
1. The total marks of the questions are 25.
2. Candidates may attempt for all 25 marks.
3. Before attempting the question paper, be sure that you have got the correct question paper.
4. The missing data, if any, may be assumed suitably.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
-------------------------------------------------------------------------------------------------------------------------------
CO BL
Q1 (a) What was the processing speed of first generation computers in seconds? [2] CO1 BL1
Q1 (b) Differentiate between minicomputers and mainframe computers? [3] CO1 BL3
Q2 (a) What are the different types of memory? [2] CO1 BL1
Q2 (b) Write the algorithm to compute area of a circle. [3] CO1,CO2 BL6
Q3 (a) What are the rules for naming a variable? [2] CO1,CO2 BL1
Q3 (b) Draw a flowchart to find largest of three numbers. [3] CO2 BL6
Q4 (a) Write the difference between compiler and interpreter? [2] CO1 BL6
Q4 (b) Write a C program to reverse an array. [3] CO4 BL6
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
Q.1(a) What is the difference between an algorithm and a method? Also discuss the difference among [5]
compiler, interpreter and assembler?
Q.1(b) Draw a flow chart to generate all numbers which are divisible by 3 but not divisible by 7? [5]
Q.3(a) What is the difference between array and variable? Write a program to find the second largest [5]
element of array elements?
Q.3(b) Write a C Program to convert characters of string to upper case. [5]
Q.4(a) Compare and contrast Call by Value and Call by reference with suitable examples? [5]
Q.4(b) Write a C program to perform matrix multiplication taking array as a function parameter. [5]
Q.5(a) (i) Discuss various valid arithmetic operations that can be performed on pointers in C with example. [3]
(ii) What is the use of type def in C? Give your definition with a suitable example. [2]
Q.5(b) (i) Explain the following functions: (i) getw() (ii) fseek() (iii) getc() (iv) feof() [2]
(ii) Write a C program to display the values and address of the elements in the array using pointer. [3]
::::::02/12/2019::::::E
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION)
INSTRUCTIONS:
1. The total marks of the questions are 25.
2. Candidates may attempt for all 25 marks.
3. Before attempting the question paper, be sure that you have got the correct question paper.
4. The missing data, if any, may be assumed suitably.
-------------------------------------------------------------------------------------------------------------------------------
Q3 (a) Write a program to input three numbers and then find largest of them using && operator. [2]
Q3 (b) Write a program using do-while loop to display the square and cube of first n natural [3]
numbers.
Q5 (a) Write a program to find the mean of n numbers using arrays. [2]
Q5 (b) Write a program to find whether the array of integers contain a duplicate number. [3]
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
Q.1(a) What is Computer Software and software development method? Write a Problem Analysis Chart (PAC) [5]
to find an area of a rectangle where area = (1/2) * height * length. Also create IC and IPO.
Q.1(b) Write down the difference between Algorithm and Flowchart. Write an Algorithm and draw a Flowchart [5]
to find Roots of Quadratic Equations AX2+BX+C=0.
Q.2(a) Compare between Switch statements with nested if statements. Which is more convenient? Justify. Also [5]
find the output of following C program fragment.
Int a=1; int b=1;
Int c= ++a || b++;
Int d= b-- & --a; printf (“%d %d %d %d”, d, c, b, a);
Q.2(b) Explain working of Bit-wise exclusive OR and Left Shift operators in C with example. Write a program [5]
to print all Prime numbers from 1 to 100.
Q.3(a) List out the advantages of Functions in C. Also write a function to find second largest number from 1D [5]
array of n numbers.
Q.3(b) Differentiate between the Following with example: [5]
i. Function Definition and Function Declaration.
ii. Actual parameter and Formal parameter.
Call by Value and Call by Reference
Q.4(a) What is the difference between Character array and String Literal? Write a C program to find the [5]
frequency of characters in String.
Q.4(b) What is Recursive Function? List out their merits and demerits also write a C program to calculate [5]
factorial of a number using recursion.
Q.5(a) Define the Storage classes in C language and compare the lifetime, scope, initial value and storage [5]
place of all storage classes.
Q.5(b) Write down the difference between Structure and Union. Write C program to write a line of String in a [5]
text file.
::::::25/11/2019::::::E
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(END SEMESTER EXAMINATION)
CLASS: BTECH/IMSc. SEMESTER: II
BRANCH: CSE/IT/EEE/ECE/PHYSICS/MATHS SESSION: SP/19
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
Q.1(a) Describe how float and double data type values are stored in computer memory. Explain with [5]
examples.
Q.1(b) Draw a flow chart to generate all numbers which are divisible by 3 but not divisible by 7. [5]
Q.2(a) Write a short note on iterative statements that C language supports. [5]
Q.2(b) Write a C Program to enter a decimal number and display the binary equivalent of this number. [5]
Q.3(a) Write the necessity of arrays in one dimension and multidimension with examples for C language. [5]
Q.3(b) Write a C program to count the total number of non-zero elements in a two-dimension array of any [5]
order for any user input data elements.
Q.4(a) Describe scope of variables for C language. Explain with an example. [5]
Q.4(b) Write a C program to sort the array of n numbers in ascending order through a user defined function. [5]
The input will be entered by user.
Q.5(a) List the advantages and disadvantages of pointers in C language. Explain with examples. [5]
Q.5(b) Write a C Program to calculate factorial of a number using recursion. [5]
:::::29/04/2019 M:::::
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION)
Q1 (a) Describe static and dynamic ways of linking and loading of program into memory. [2]
(b) Define Compiler. Differentiate between object code and executable code. [3]
Q3 (a) Explain the difference between declaration and definition in C program [2]
(b) Write a C program for multiplication table of 12 using bitwise shift operator. [3]
Q4 (a) Write a C program which will take two integer numbers as an input from user and print [2]
the sum without using any arithmetic operator.
(b) Write a C program to print asterisks in a pyramid structure. [3]
Q5 (a) Write a C program to calculate the number of duplicate entries in the array. [2]
(b) Write a C program that reads/input any square matrix and replace value zero on the [3]
diagonals, 1 on the upper triangle and -1 on lower triangle of the matrix as an output.
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
Q.2(a) What are decision control statements? Explain with examples. [5]
Q.2(b) Write a C program to test a given number is a power of 2. [5]
Q.3(a) Why are arrays needed? How is an array represented in memory? Explain with diagram. [5]
Q.3(b) Write a C program to sort an array of integers. [5]
Q.4(a) What is call by value and call by reference? Explain with an example. [5]
Q.4(b) Write a C program to read an integer number. Print the reverse of this number using function. [5]
Q.5(a) Differentiate between Structure and Array. Explain with suitable examples. [5]
Q.5(b) Write a C program using pointer to search a value from an array. [5]
:::::14/12/2018:::::M
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(MID SEMESTER EXAMINATION)
INSTRUCTIONS:
1. The total marks of the questions are 25.
2. Candidates may attempt for all 25 marks.
3. Before attempting the question paper, be sure that you have got the correct question paper.
4. The missing data, if any, may be assumed suitably.
-------------------------------------------------------------------------------------------------------------------------------
Q3 (a) Distinguish between typecasting and type conversion with examples in C. [2]
Q3 (b) Write a C program to print the prime factors of a number. [3]
Q4 (a) Illustrate with examples what do you mean by decision control statements in C. [2]
Q4 (b) Write a C program that displays all the numbers between a user input range that are [3]
divisible by 2 as well as by 3.
Q5 (a) Write a C program to read an array and display the array of n numbers. [2]
Q5 (b) Develop a C program to find the product of two matrix and display it’s result. [3]
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
Q.1(a) Broadly classify the computer system into two parts. Also make a comparison between a human body [5]
and the computer system thereby explaining what each part does.
Q.1(b) Define an algorithm. Discuss the various elements/properties of an algorithm. [5]
Q.2(a) A company decides to give bonus to all its employees on Diwali. A 5% bonus on salary is given to the [5]
male workers and 10% bonus on salary to the female workers. Write a C program to enter the salary and
sex of the employee. If the salary of the employee is less than Rs. 10,000 then the employee gets an
extra 2% bonus on salary. Calculate the bonus that has to be given to the employee and display the
salary that the employee will get.
Q.2(b) Change the following for loop into a while loop. Also convert the for loop into a do-while loop. [5]
int I; for(I =10; I>0; I--) printf(“%d”, I);
Q.4(a) Write a C program to read a sentence. Then count the number of words in the sentence. [5]
Q.4(b) Write a recursive C program to calculate GCD of two numbers. [5]
Q.5(a) Declare a structure fraction that has two fields- numerator and denominator. Create two variables and [5]
compare them using function. Return 0 if the two fractions are equal, -1 if the first fraction is less than
the second and 1 otherwise. You may convert a fraction into a floating point number for your
convenience.
Q.5(b) Enlist at least four file operations. Write a C program to read a file and display its contents on the [5]
screen. Give sufficient comments in your program to make it understandable to others.
:::::28/11/2018:::::M
BIRLA INSTITUTE OF TECHNOLOGY, MESRA, RANCHI
(END SEMESTER EXAMINATION)
CLASS: MSC SEMESTER : IV
BRANCH: MATHEMATICS SESSION : MO/2023
INSTRUCTIONS:
1. The question paper contains 5 questions each of 10 marks and total 50 marks.
2. Attempt all questions.
3. The missing data, if any, may be assumed suitably.
4. Before attempting the question paper, be sure that you have got the correct question paper.
5. Tables/Data hand book/Graph paper etc. to be supplied to the candidates in the examination hall.
----------------------------------------------------------------------------------------------------------------------------------
CO BL
Q.1(a) Discuss software development method with the help of example of finding area of a [5] 1 2
triangle when coordinates of vertices of a triangle is given
Q.1(b) Explain flowchart, its type and symbols with help of examples [5] 1 1
Q.3(a) Differentiate between call by value and call by reference with example. [5] 3 2
Q.3(b) Write a C program to find addition of two matrices using 2-d array. [5] 3 2
Q.4(a) Differentiate between character array and strung literals. Write a C program to find [5] 4 2
frequency of characters in a string.
Q.4(b) Define recursive function and list out its merit and demerits. Write a C program to find [5] 4 2
GCD of number using recursion.
:::::28/11/2023 E:::::