How To Exam?

a knowledge trading engine...


IIT Mandi 2010-1st Sem B.Tech Computer Science and Engineering Computer science cs101 end sem - Question Paper

Saturday, 02 February 2013 11:55Web
A B
1 =B1+1 =A1+1

d) Assuming a 6-bit word, what is the range of integers that can be represented using:
(i) 1s complement
(ii) 2s complement

e) For every of the subsequent kind declarations, indicate the fault if any.
i) float, mass, wt, ht;
ii) int real, boolean, digit;
iii) unsigned integer, x, y;
iv) double x.img, y.real, complex;

4) If a = 8, b = 15, c = 0, obtain the values of the subsequent expressions: [3]

(1) a != six && b > 15

(2) a == nine || b < 23

(3) five && c != eight || !c

5)
(a) Name the three standard streams in C. [3]
(b) Write the command line that would be used to redirect the output of myprog to the
file f.out.

6) In the subsequent fill in the actions taken by fopen() with various mode arguments. [4]

Mode Action if file exists Action if file does not exist
"w" ..................... ...........................
"r" ..................... ............................
"a" ..................... ...........................
"w+" ..................... ...........................

7) The program recho.c is supposed to echo its command-line arguments in reverse order.
That is, recho 1 2 3 will outcome in the output 3 2 one. Fill in
the code beneath. [4]

#include
int main(__________________________)
{
_________________
for (____________________________________)
printf(_____________________________________)
_______________________
exit(0);
}

8) Fill in the blanks in the pseudo-code for the Newton-Raphson method to obtain the root of
the function f(x). [4]
1. select ? > 0
m > 0
x0
k
calculate f0 = ________________
2. Do {
q =________________
x1= ________________
x0 = x1
______________________
____________________
} while ____________________________

3. Root = ________________

9)
(a) find (1/3)4 by successive multiplication using 4-digit arithmetic (i.e. the outcome after
every multiplication is truncated to 4-digits). [2]
(b) Repeat the above using 6-digit arithmetic. [2]
(c) provided the measured data in the table below, obtain the function f(x) = a + bx with
minimum mean squared fault. [3]

x 0 two 4
y three 14 25

10) An OpenOffice spreadsheet contains Roll ANJALI 89
Numbers, Names and Marks in three columns as BALARAM 56
shown in the sample to the right. List the CHAITANYA 86
sequence of steps that you would use to sort the MUSTAFA 43
data in descending order of Marks. In case ZERKSIS 67
several students have got the identical marks, they SURJIT SINGH 73
are to be sorted in order of Roll Number. [3]
1.
2.
3.
4.
5.
6.

11) {4}
(a) provided eight data points, is it possible to find a Lagrangian polynomial of order 16?
Justify your ans.
(b) provided n base points, the Lagrangian multiplier Qk(x) is a polynomial of degree
_______________ that is _____________________
at only the ______________________________
(c) Write the formula for the Lagrangian polynomial in terms of the Lagrangian multipliers.

12)
provided the function f(x) = 7x3 – 3x2 + 6x + 23, write a C function fh(int x) that returns the
value of f(x) evaluated using Horner's method. [3]
int fh(int x)
{
int temp;
temp = ________________________________________;
return _________________________;
}

13)
provided the sides of a rectangle, fill in the code for the function IsAreaBigger() that returns
actual if the area of the rectangle is bigger than its perimeter. [3]
int IsAreaBigger(int l, w)
{
int area, peri;
area = ________________________________________;
peri = ________________________________________;
return _________________________;
}

14)
Pick the incorrect C floating point constants from the list beneath. discuss why they are
incorrect. [3]
a) 40,943.687
b) 45.7E-32
c) 56+E23
d) 1/2.2
e) 99
f) 469xE-3

15)
An insurance company uses the subsequent rules to compute premium: [4]

a) If a man's health is good and he is not more than 35 years of age then the premium is
Rs. two per thousand, and his policy may not be written for more than Rs. two lakhs.

b) For a woman who satisfies the above condidtions, the premium is Rs. 1.50 per
thousand, and her policy may not be written for more than Rs. three lakhs.

c) A person above the age of 35 pays double the above premiums, and has the identical
policy limits.

d) A person in poor health is not insured.

Draw a neat flow chart to determine the eligibility of a person for insurance, his/her
premium and the maximum amount of insurance.

0). Write in the box the marks that you expect to get on this exam? If your ans is within
±2 of your true marks, you will receive one grace mark! [1+1 grace]






( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER IIT Mandi 2010-1st Sem B.Tech Computer Science and Engineering Computer science cs101 end sem - Question Paper