/> M3-R4: PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE JAN 2020

M3-R4: PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE JAN 2020


M3-R4: PROGRAMMING & PROBLEM SOLVING  THROUGH ‘C’ LANGUAGE JAN 2020



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 appropriateo ne and enter in the “OMR” answer sheet supplied with the question paper, following

instructions therein. (1x10)


1.1 What is the following is invalid header file in C?
(A) math.h
(C) string.h 
(B) mathio.h

(D) ctype.h


1.2 Which of the following is not a keyword of C ?
(A) auto
(B) case
(C) break
(D) function

1.3 Strings are character arrays it always ends with
(A) \n
(B) \t
(C) \0
(D) \1

1.4 Find an integer constant
(A) 3.145
(B) 34
(C) 125
(D) none of these

1.5 Standard ANSI C recognizes______________number of keywords.
(A) 16
(B) 32
(C) 64 

(D) 128


1.6 Which is the only function that all C program must contain?
(A) start() 
(B) system()
(C)) main()

(D) scanf()



1.7 Find output of the following program
#include<stdio.h>

#include<conio.h>

void main()
{
char a[] = { ‘A1, ’B1, ‘C1, ‘D’ };
char* ppp = &a[0];
*ppp++;
printf(“%c %c “, *++ppp, –*ppp);
(A) C A
(C) BC
(B) C B
(D) B A


1.8 Find output of the following program
#include <stdio.h>

#include<conio.h>

void main()
{
char ch;
int i;
ch = ‘G1;
i = ch-’A1;
printf(“%d”, i);

(A) 5 
(B) 6
(C) 7 
(D) 8


1.9 How many times is a do while loop guaranteed to loop ?
(A) 0 
(B) Infinitely
(C) 1  

(D) Variable


1.10 Which of the following is not a proper storage class in ‘C’?
(A) auto 
(B) dec
(C) static 

(D) extern


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 In C, upper and lower cases letter are same. 
[FALSE]

2.2 = is used for comparison, whereas, = = is used for assignment of two quantities.

[FALSE]


2.3 A function can be defined inside another function.
[FALSE]

2.4 In switch statement, the default case is optional. — 
[TRUE]

2.5 strlenQ function counts the number of characters in a given string and returns the integer value.
[TRUE]

2.6 The continue statement cannot be used with switch statement. 
[TRUE]

2.7 The basic meaning of the C keywords can be changed. 
[FALSE]

2.8 Functions can be called either by value or reference. — 
[TRUE]

2.9 The + + operator increments the operand by 1, whereas, the — operator decrements it by 1. -[TRUE]

2.10 #define lines should end with a semicolon. 
[FALSE]

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
 It is an unconditional jump statement. [J]
A
Exit controlled loop
3.2
Function that concatenate strings. [I]
B
Shift Left
3.3
It is used to link the related expression together. [F]
C
sizeof
3.4
 Symbol ‘=’ [G]
D
Character test function
3.5
 getw() [K]
E
Entry controlled loop
3.6
int*p [F]
F
Declare a pointer
3.7
While [E]
G
Assignment operator
3.8
isalpha[D]
H
Comma
3.9
 do…. while I [A]
I
strcat()
3.10
« [B]
J
goto
K
Read an integer from a file
L
Declare an array
M
strlenQ


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
Newline
B
Increment
C
sizeof
D
Overlooking
E
Bell
F
Math.h
G
Dot
H
Structured
I
islower()
J
And
K
Union
L
Link
M
&&


4.1 C language was implemented at the __Bell__ Laboratries.

4.2 C language is well suited for ____Structured___ Programming

4.3 The operator “++” is known as __increment___ oprator.

4.4 The____sizeof_____C- operator can be used to determine the length of array and structures.

4.5 . The standard mathematical functions are included in the ___math.h___ header file.

4.6 The __link__ section provides instruction to the compiler to link functions from system library.

4.7 The __and__ operator is true only when both the operands are true.

4.8 __Dot__ operator is used to connect structure name to its member name.

4.9 ___islower()___ function checks whether the entered alphabets are lower case letter or not.


4.10 __Newline__is a character used to represent the end of a line of text and the beginning of a new line.

PART TWO
(Answer any FOUR questions)

5.
a)What is flow chart ? List the symbols that are used to draw a flow chart. Develop a flowchart to find out the minimum of the given three numbers.
b)What do you mean by decision making in C? Which are the statements in C that provide the facilities of decision making and Branching ? Explain nested if else statement with suitable example.

6.
a)What do you mean by user defined Function ? Explain the function definition, function declaration and function call with syntax and suitable example ?
b)What do you mean by an Array ? How to declare and initialize 1-D array in C ? What is a limitation of an array? Write a program to perform the addition of 3×3 matrices using an array.

7.
a) Define a Structure named “Student” with roll_no,name and percentage as members read the data of 3 students from user and display them in proper format.
b)List the various types of loop available in G and explain any one with the syntax and suitable example.
c) What is a string? How to declare and initialize a string? Explain the use of strcpy(),strcat() function.

8.
a) What do you mean by Recursion? Write a program to find factorial of given number using recursive function.
b) Write a program using pointer to find greatest number in an array.
c) What is type conversion? Explain Implicit and Explicit type conversion with suitable example.

9.Explain briefly any three from the following :
a)Explain the use of malloc() and calloc() in dynamic memory allocation.
b)Define pointer. How to declare and initialize pointer? Narrate any two advantages of pointer.
c)What are the uses of following file handling function:
fopen()

fclose()

fseek()
ftell(),
rewind ()

d) Write a program to swap two numbers without using third variable.

- o O o -

0/Post a Comment/Comments

Leave a Reply

Previous Post Next Post