Monday 11 July 2016

M3-R4: PROGRAMMIMG AND PROBLEM SOLVING THROUGH ‘C’ LANGUAGE January, 2015


M3-R4: PROGRAMMIMG AND PROBLEM SOLVING THROUGH ‘C’ LANGUAGE

NOTE:
IMPORTANT INSTRUCTIONS:

1. Question Paper in English and Hindi and Candidate can choose any one language.
2. In case of discrepancies in language, English version will be treated as final.
3. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and
PART TWO contains FIVE questions.
4. PART ONE is to be answered in the OMR ANSWER SHEET only, supplied with the question
paper, as per the instructions contained therein. PART ONE is NOT to be answered in the
answer book.
5. Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be
supplied at the table when the answer sheet for PART ONE is returned. However, candidates,
who complete PART ONE earlier than one hour, can collect the answer book for PART TWO
immediately after handing over the answer sheet for PART ONE.

TOTAL TIME: 3 HOURS TOTAL MARKS: 100
(PART ONE – 40; PART TWO – 60)

PART ONE
(Answer all the questions)


1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)

1.1 The two type of file structures existing in VSAM file are
A) Key sequenced structures, entry sequenced structures
B) Key sequenced structure, exit sequenced structures
C) Entry sequenced structures, exit sequenced structures
D) None of the above

View


1.2 In a multilist organisation
A) records that have an equivalent value for a given secondary index item are linked together to
form a list
B) records are loaded in ordered sequence defined by collating sequence by content of key
C) records are directly accessed by records key field
D) none of the above
View

1.3 *ptr ++ is equivalent to
A) ptr++
B) *ptr
C) ++ptr
D) ++*ptr
View

1.4 Declaration int *(*p) int(*a) is
A) A pointer to function that accept an integer argument and return an integer
B) A pointer to a, which returns an integer
C) A pointer to subroutine which returns an integer
D) None of the above
View


1.5 The output of following program would be
main()
{ printf(“d%d%d%” sizeof(3.14f), sizeof(3.14l);}
is
A) 4,8,10
B) 8,4,10
C) 18,8,4
D) None of the above
View

1.6 An example of hierarchical data structure is
A) array
B) link list
C) tree
D) all of the above
View

1.7 The do..while looping statement
A) is executed only once if the conditions is true
B) is also known as entry-controlled loop
C) is executed at least once if the conditions is false
D) the unconditional loop
View

1.8 Which of the following is not a proper storage class in ‘C’?
A) auto
B) dec
C) static
D) extern
View

1.9 The average number of comparison is sequential search is
A) n**2
B) n(n-1)/2
C) n(n+1)/2
D) (n+1)/2
View

1.10 Tell whether the following tree is:



A) Heap
B) Full and Complete
C) Heap Complete
D) None of the above
View

2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and
ENTER in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)

2.1 A command that lets you change one or more fields in a record is look up.
2.2 In relational schema each tuple is divided into fields called relations.
2.3 The best average SORTING behavior is shown by merge sort.
2.4 The data structure that is needed to convert infix notation to prefix notation is graph.
2.5 The best case and worst case time for searching an element using linear search is 1, n.
2.6 Forest is a set of N>=0 disjoint trees, which are obtained when root is removed.
2.7 PERT graph is a graph used to perform PERT calculation.
2.8 Priority queue is a queue that is used to store priority data.
2.9 A symmetric diagraph is a directed graph such that for every edge VW there is reverse edge
WV.
2.10 Maximum degree in any vector in a graph with n vertices is n-1.

View Answer


3. Match words and phrases in column X with the closest related meaning/word(s)/phrase(s) in column Y. Enter your selection in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)

                             X                                                       Y

3.1 Null pointer is                                                A. Files that are stored on a direct access
medium
3.2 Number of operators required                       B. 2 bytes
in ?: operators                                                
3.3 Null macros is                                               C. manipulator
3.4 A direct access file is                                    D. Number of tracks and number of
sectors per track
3.5 Seek time is                                                   E. The region over which the variable
declaration has effect
3.6 A function that change state                          F. A pointer which does not point
 object is called                                                       anywhere
3.7 FORMAT command in DOS                         G. Three
 is used to establish
3.8 Scope of a variable is                                    H. Contains pointer to itself
3.9 A self referential structure is                         I. Files that are stored on a random
access medium
3.10 Size of a pointer in small                            J. A macro that represent null pointer
 memory model is
                                                                           K. Depends upon context
                                                                           L. Time taken by read write head
                                                                                mechanism to position itself over
                                                                                appropriate cylinder
                                                                           M. Two

View Answer

4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)


A. OR
B. 0 (Logn)
C. 32 KB
D. open source software
 E. RAM
F. And
G. stdio.h
H. single
 I. insertions sort
J. 0 (nlogn)
K. 64 KB
L. Dijkstra’s algorithm
M. goto



4.1 An example of volatile memory is ________.
4.2 The ________ operator is true only when both the operands are true.
4.3 LINUX is an example of ________.
4.4 By default a real number is treated as ________.
4.5 Header file in which NULL macro is defined is ________.
4.6 Memory that can be allocated in a single call to macro is ________.
4.7 Total number of comparison in bubble sort is ________.
4.8 Arranging pack of cards by picking one by one is an example of ________.
4.9 All pair shortest path problem can be solved by ________.
4.10 Avoid the use of ________ statement in the program.

View Answer

PART TWO
(Answer any FOUR questions)

5.
a) A lucas sequence is given below:
1, 3, 4, 7, 11, 18, 29
The third number is sum of previous two numbers. Write a program to print first 10 numbers of
lucas sequence.
b) Write a program to print the value of numbers in words when number entered is in the range of
0 to 999.
c) With the help of suitable example, explain the functioning of switch statement.
(5+5+5)

6.
a) Explain the function performed by following library function of ‘C’:
i) getch
ii) getche
iii) getchar
iv) putchar
v) putch
b) Describe output of following program:
#include<stdio.h>
main()
{ auto int i=10;
{ auto int i=5;
printf(“%d”, i);
}
printf(“%d”, i+s);
printf(“%d”i);

Answer : error will be generated because s is undefined

c) Explain the following:
i) static variable
ii) auto variable
iii) register variable
(5+5+5)

7.
a) Explain the difference between logical and bitwise operator.
b) Write a program using pointer to find greatest number in an array.
c) Assuming ip is a pointer; explain the function of following statements:
i) ip = ip + 5;

Answer : 

Ip is pointer and it will be jump 5 steps forward continuously from current position.

ii) ip = ip – 10;

Answer : 

Ip is pointer and it will be jump 5 step backward from continuously from current position.

iii) ip –

Answer : 

Ip move one step back to current position

iv) *ip++
Answer :
Current value will increase by of variable point by Ip

v) *ip –

Answer :

Current sign will be of variable point by Ip
(5+5+5)


8.
a) Assume following code:
int dat = 100;
int *var
var = &dat;
Here dat is an integer variable and var is a pointer. Answer the output of the following
statements, in this regards and explain your answer.
i) printf(“%d”, * var);
Answer:
Output will be 100 because var point Dat and * is used to access pointed variable data.Output will be 100 because var point Dat and * is used to access pointed variable data.

ii) printf(“%d”, (* var)++);
Answer : 
Output will be 100 because var point Dat and * is used to access pointed variable data. In given equation a postfix operator is used so first current value will be print then increment will be apply.

iii) printf(“%d”, var);
Answer:
Garbase will be print because capacity if %d is 32768 in 16 bit compiler and address space has larger number. When an attempt made to print address using %d overflow will be apply.

iv) printf(“%d”, -var);
Answer : 
Garbase will be print because capacity if %d is 32768 in 16 bit compiler and address space has larger number. When an attempt made to print address using %d overflow will be apply. Only add and subtract is allowed.

b) Write a program to find greatest number in an array.
(10+5)

9.
a) Enumerate the difference between:
i) structures and union
ii) union and enum
b) Explain the difference between text mode and binary mode files.
c) Write a program to copy a file into another file.
(5+5+5)

No comments:

Post a Comment