Pages

Saturday, 16 October 2021

Solved : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , January 2021 | NIELIT O Level

 Solved : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , January 2021 | NIELIT O Level

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.


1.1 Which of the following is not a valid variable name declaration ?
(A) int
(B) abc_int
(C) abc
(D) abc_abc 

1.2 The format identifier '%i is also used for data type.
(A) char
(B) float
(C) int
(D) double 

1.3 Library function pow() belongs to which header file ?
(A) math.h
(B) maths.h
(C) ctype.h
(D) powerofmaths.h

1.4 Prototype of a function means
(A) Name of Function
(B) Output of Function
(C) Declaration of Function
(D) Input of a Function

1.5 Which of the following is not an example of looping statement ?
(A) for
(B) switch
(C) while
(D) do...while

1.6 What is the action of strcmp() function ?
(A) Compare two strings
(B) Copies one string over another
(C) Finds the length of a string
(D) Cut one string over another 

1.7 Find output of the following program : #include<stdio.h>
#include<conio.h>
void main()
{
if(printf("C programming is"))
{
printf("Easy");
else
{
printf("Hard");
(A) Easy
(B) Hard
(C) C programming is Easy
(D) EasyHard

1.8 Find output of the following program : #include<stdio.h>
#include<conio.h>
void main()
{
int i = 0, j = 0;
while (i < 5, j < 10)
{
i++;
j++;
I
printf("%d %d", i, j);
I
(A) 5 5
(B) 10 10
(C) 5 10
(D) 10 5

1.9 Which of the following is not a proper storage class in 'C' ?
(A) auto
(B) dec
(C) static
(D) extern

1.10 Identify the correct sequence of steps to run a program :
(A) link, load, code, compile and execute
(B) code, compile, link, execute and load
(C) code, compile, link, load and execute
(D) compile, code, link, load and execute
Answer


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.


2.1 C programs are converted into machine language with the help of compiler.
2.2 The keyword void is a data type in C.
2.3 Functions can be called either by value or reference.
2.4 If return type for a function is not specified, it defaults to int.
2.5 Are the expression *ptr++ and ++*ptr are same ?
2.6 malloc() returns a NULL if it fails to allocate the requested memory.
2.7 A union cannot be nested in a structure.
2.8 An array is a fixed-size non-sequential collection of elements of the different data type.
2.9 ftell() returns the current position of the pointer in a file stream.
2.10 Bit fields cannot be used in union.


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. 


X

Y

3.1

Function call itself

A.                  

#define

3.2

Logical AND

B. 

getw()

3.3

Reads a character from a file.

C.                  

malloc()

3.4

(type-name)expression

D.                  

recursion

3.5

exp1 ? exp2 : exp3

E. 

&&

3.6

Dynamic memory allocation

F.  

conditional operator

3.7

Copies one string over another

G.                 

explicit conversion

3.8

Defining Symbolic constant

H.                 

Union

3.9

String constants

I.   

getc()

3.10

Reads an integer form file

J.  

"final"

 

 

K.                 

while

 

 

L. 

for

 

 

 M

strcpy()



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 attached to the question paper, following instructions therein. (1x10)


A.

flowchart

B.

automatic

C.

modular programming

D.

char

E.

switch

F.

Implementation

G.

Address of variable

H.

same

I.

different

j.

'\t'

K.

null

L.

#define

M.

C tokens

 

 

 

 


4.1 In C program the smallest individual units are known as ______
4.2 ______backslash character constants.
4.3 ______ is a data type in C.
4.4 Pointer holds ______.
4.5 Pictorial representation of an algorithm is ______
4.6 The Implicit type conversion is ______ type conversion.
4.7 A multiway decision statement in C known as a ______
4.8 An Array is a fixed-size sequenced collection of element of the______ data type.
4.9 In user defined function, function definition is also known as function ______
4.10 A pointer that is pointing to nothing is called ______ pointer.



Part Two



Q 5 

(b) C ? Explain the concept of Array of Structures and Array within structures with suitable example.

(7+8)

Q 6

(a) Explain the concept of multiway decision statement in C ? Explain nested switch statement with suitable example.

(b) How to declare and initialize 2-Dimensional array in C ? Write any two advantages of an array. List the application of any array. Explain any one application with suitable example.

(7+8)


Q 7

(a) Write a program to add two integer numbers using following categories of function :

     (i) Function with no argument and no return value

     (ii) Function with an argument and a return value

(b) Draw a flowchart to find the Fibonacci series till term 1000.

(c) Write a program to count number of vowels in a string.

(5+5+5)


Q 8
(b) Write a program to print a following  triangle using for looping statement.
1
22
333
4444
55555

(c) Explain Arithmetic Operators and  Logical Operators with suitable example.
(5+5+5) 

Q 9
(a) What do you mean by dynamic memory allocation ? Explain free() and realloc() with example.
(b) What is the limitation of pointer ? Explain concept of pointer to function in C.
(c) Which are the operation that can perform on file in C ? Explain fprintf() and fscanf() with suitable example.
(d) Write a program to find the length of the entered string.
(Do not use inbuilt string function)

(3x5)


No comments:

Post a Comment