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

Saturday, 02 February 2013 11:55Web

Page 1 of 2

ans all ques.. No calculators or cellphones. Maximum marks: 70

**1)**Fill in the blanks: [6]

**a)**The method in which arguments are passed to functions by sending the addresses of the

arguments is called __________________________________.

**b)**The ________________ unary operator cannot be applied to a float or double.

**c)**A leading 0x on an integer constant means that it is _______________________

**d)**Enum provides an option to ______________________

**e)**provided the declarations below:

struct time

{

int hours;

int mins;

int secs;

} t;

struct time *tt;

tt = &t;

two ways of referring to the seconds field of tt are ________________________

and ___________________________.

**f)**When finding the root of an equation, the _________________________ method is

guaranteed to converge while the ___________________________ method may not

converge.

g) The minimax approximation ____________________ the maximum

______________________________.

h) The OpenOffice functions to calculate the avg. and standard deviation of a set of

numbers are ______________________ and ___________________________.

**2)**ans briefly: [8]

**a)**Write a C statement to create an array of 20 floats at runtime.

**b)**Using the ? operator, write an expression whose value is the maximum of 2 integers

a and b.

**c)**What is the difference ranging from the gdb commands step and next?

**d)**Write equivalent code using a while loop:

for(i=0; i<10; i++)

{

do Something();

}

**e)**What does this loop print?

for (i = 0; i < 10; i += 2)

printf("%d\n", i);

**f)**What does this loop print?

for (i = 2; i < 100; i *= 2)

printf("%d\n", i);

g) Suppose the root of the function f

**(**is used to estimate the avg. marks in this final

**x)**exam. The function is known to have several roots with values approximately equal

to 0.045, 45, 245 and 4,5

**4**choose the initial values x0 and x1 to be used with the

**5.**regula falsi method.

h) To ensure that it terminates, what kind of statement must be included in every

recursive function?

**3)**ans briefly: [10]

**a)**Suppose the current working directory in a shell window is

~/cs110/assign1/dat

**a.**It is desired to create a directory for assign2 and

make this the current directory. provide a sequence of shell commands to achieve this.

**b)**Suppose that an examiner is observed to take 30 seconds to accurate five objective

ques. and corrects 10 ques. in 45 seconds. It is desired to estimate how long

she will take to accurate 50 ques.. Would you use linear or quadratic or exponential

regression? Justify your ans.

**c)**Suppose the cells A1 and B1 in a spreadsheet contain formulae as shown below, what

do you expect will be the result? discuss your ans.

Earning: Approval pending. |