How To Exam?

a knowledge trading engine...


Indian Institute of Technology Kharagpur (IIT-K) 2010 M.Sc Mathematics 4nd year B.Tech (Programming languages) - Question Paper

Wednesday, 23 January 2013 10:15Web


INDIAN INSTITUTE OF TECHNOLOGY, KHARAGPUR
Date:...............FN/SN Time:3 Hrs Full Marks: 50 No. of students: 50
END(Autumn) Semester 2010-11, Dept: MA/EX Sub. No. MA41021
Subject Name: Programming Languages

Instruction: ans all ques. in brief. Default situation is C Programming Language.

Summary: This exam is conducted to Undergraduate students of the departments of Mathematics and Exploration Geophysics in their fourth year during seventh semester.
Subject mainly consists of basic Programming language

Indian Institute of Technology, Kharagpur

Date......................FN/AN Time: 3 Hrs Full Marks: 50 No. of Students: 50

END (Autumn) Semester 2010-11, Deptt: MA/EX Sub. No. MA41021 Subject Name: Programming Languages

Instruction: Answer all questions in brief. Default context is C programming language. Question 1 [2 x 6 marks]

What is the difference between

a)    void fun(int a\ ]) and void fun(int * a);

b)    array and linked list;

c)    Stack and Queue;

d)    a doubly linked list and a circular linked list;

e)    char b[} = Hello and char*b= Hello.

f)    float a[10] and struct new a[5], where

struct new {float &[2];};

Question 2 [5 marks]

If a five-digit number is input through the keyboard

a)    write a program to reverse the number, e.g. if the input is 69718, the output is 81796.

b)    write a program to find the sum of square of the digits, e.g. if the input is 69718, the output is the value of 62 + 92 + 't1 + l2 + 82.

Question 3 [4 marks]

Write a program which can collect student information (student name, roll number, sex and date of birth) of a class and display the collected information.

P.T.O


Write a program which given two integer input T and (?, will output the combination of T things into G groups, e.g. if T = 5 and G = 3, the output will be

(5,0,0)

(4.1.0)

(3.2.0)

(3.1.1)

(2.2.1)

Question 5 [5 marks]

a)    How can one dynamically allocate a two dimentional array?

b)    Represent a Sparse matrix of order 100 x 100 with 9 non-zero elements using linked list.

Question 6 [5 marks]

Let P(x) = 1.9x5 + 2.3a;3 + 1.3a; + 7 and Q(x) x +1 be two polynomials.

a)    Write a program to find P{x) -f Q{x) using array;

b)    Write a program to find P(x) x Q(x) using linked list.

Question 7 [6 marks]

a)    Explain with diagram the deletion and addition operations in stack and queue using linked list.

b)    Write a program to implement a doubly linked list as a circular linked list.

Question 8 [6 marks]

What will be the output of the following programs: a)

main()

{ int x = 1;

while (x == 1) x = x 1; printf(\n%cT,2:);

P.T.O------

b)

main( )

{ int a: = 4, y, z;

V = - -z ~ x--;

printf( tl\n%d%d%<T, x, y, z);

}

c)

main()

{ int i = 1;

printf(%d%d%cf ,i,+ -M, i + +);

}

d)

main( )

{ int i = 1; while (1)

(printf(%d,i); i + +;

}

>

e)

main()

{ int arr[ ] = {0,1,2,3,4}; int i, *Ptr;

for(Ptr = &arr[0], i = 0; i <= 4; i + +) printf(%i, Ptr[i]);

}

f)

main( )

{int 6[] = {10,20,30,40,50}; int *k; k = &6[4] - 4; for(i = 0; i <= 4; i + +) {printf(%cT,*fc); k + +-,

}

}

--The End-







Attachment:

( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Indian Institute of Technology Kharagpur (IIT-K) 2010 M.Sc Mathematics 4nd year B.Tech (Programming languages) - Question Paper