Pages

Saturday, 25 April 2020

Solved : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , July 19

Solved : NIELIT (O-Level) PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE , July 19

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.

1.1 : Which of the following is a keyword used for a storage class ?
(A) printf
(B) external
(C) auto
(D) scanf
Answer

1.2 : Which pair of functions below are used for single character I/O ?
(A) getchar( ) and putchar( )
(B) scanf( ) and printf( )
(C) input( ) and output( )
(D) None of these
1.3 : What is the output of below program ?
void main( )
{
char*p="Hello world";
int*q;
p++;
q = (int*)p;
q++;
printf("\n%s\n%s",p,q); 
}
(A) ello world Ello world
(B) Compiler error
(C) lo world lo world
(D) ello world world
1.4 : Which of the following is a Scalar Data type ?
(A) Float
(B) Union
(C) Array
(D) Linked list 
1.5 : Header files in C contain :
(A) Compiler commands
(B) Library functions
(C) Header information of C programs
(D) Operator for files
1.6 : What is the binary number equivalent of the decimal number 12 ?
(A) 1100 (B) 1010
(C) 1001 (D) 1110
1.7 : Pointers are of :
(A) integer data type
(B) character data type
(C) unsigned integer data types
(D) none of these
1.8 : In C, if you pass an array as an argument to a function, what actually passed ?
(A) Value of elements in array
(B) First element of the array
(C) Base address of the array
(D) Address of the last element of array
1.9 : Which of the following fopen( ) statements is illegal in C ?
(A) fp = fopen("abc.txt", "r");
(B) fp = fopen("c:/user1/abc.txt", "w");
(C) fp = fopen("abc", "w");
(D) none of the mentioned
1.10 : Which one of the following is not a keyword in C language ?
(A) main (B) endl
(C) float (D) switch
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 Array int a[5] can be used to store five character a, b, c, d and e into it.
2.2 C language was initially designed and developed at Microsoft Corporation of USA.
2.3 A semicolon must be placed after closing the conditional expression in a do-while construct.
2.4 Ternary expression is a selective control construct.
2.5 All the functions, except main( ) function do not execute on their own, they require a calling function.
2.6 Recursive call is not allowed for main( ) function.
2.7 A structure cannot contain the structure itself as its member. 
2.8 Pointers to pointers is a term used to describe pointers whose contents are the address of another pointer.
2.9 In C, there is a function name strcat( ) used to concatenate two strings.
2.10 Values of predefined macros can be printed using printf statement in C program.

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
Keyword used to transfer control from a function back to the calling function
A.
fseek( )
3.2
Statement used to go to the next iteration in a loop
B.
malloc( )
3.3
Library function used to clear the specified buffer
C.
switch-case control
3.4
Relational operators cannot be used on
D.
loops control
3.5
Function that allocate and clear allocated memory
E.
argument
3.6

If you have to use many if-else conditions, they can be usually implemented by
F.

fflush( )
3.7

A piece of information passed to a method
G.

for( ; ; )

3.8

Function that allocates memory but does not clear allocated memory

H.

return

3.9

Function used for file pointer movement

I.

continue

3.10

Unending loop if no break statement inside the body

J.

break



K.

main( )



L.

structure



M.

calloc( )


Answer


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

A.

Ternary
B.

sizeof
C.

null

D.

void

E.

semicolon

F.

#

G.

increment

H.

extern

I.

static
J.
structure
K.
pointer to pointer
L.
reference
M.

getch( )





4.1 C language is well  suited for ....... programming.

4.2 An ....... storage class can be used to declare global variable known to all the functions in the file.

4.3  .......  function can be used to read a single character.

4.4 The operator   "++'' is  known as ....... operator.

4.5 The ....... operator can be used to allocate memory space dynamically to variables during execution of a program.

4.6 A ....... variable points to another pointer.

4.7 A function with no return type is declared as  .......  .

4.8 A  function  prototype is always terminated by sign.

4.9 When a structure is passed to a function, then it should pass by ....... .

4.10 The conditional operator (?:) is a ....... operator.

Answer


PART TWO
(Answer any FOUR questions.)

5.
(5+5+5=15)

6.

7.

8.

9.

No comments:

Post a Comment