/> M3-R4 : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE JULY 2019

M3-R4 : PROGRAMMING & PROBLEM SOLVING THROUGH ‘C’ LANGUAGE JULY 2019


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

Q.1. Multiple Choice of Answers.

1.1 Which of the following is a keyword used for a storage class?
A. Printf
B. External
C. Auto
D. scanf.

1.2 Which pair of functions below are used for single character I/O?
A. getchar () and putchar()
B. scanf () and print()
C. input () and printf()
D. None of these

1.3 What is the output of below program?
void main(){
char *p=”Hello world”;
int *q;
p++;
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.4Which of the following is a Scalar Data type?
A. Float
B. Union
C. Array
D. Linked list

1.5Header files in C contain:
A. Complier commands
B. Library functions
C. Header information of C programs
D. Operator for files

1.6What is the binary number equivalent of the decimal number 12?
A. 1100
B. 1010
C. 1001
D. 1110

1.7Pointers 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     

                                               
                                                     Q.2. TRUE or FALSE.

2.1 Array int a[5] can be used to store five character a, b, c, d and e into it.
[FALSE]

2.2 C language was initially designed and developed at Microsoft Corporation of USA. [FALSE]

2.3 A semicolon must be placed after closing the conditional expression in a dowhile construct. [TRUE]

2.4 Ternary expression is a selective control construct.
[TRUE]

2.5 All the functions, except main() function do not execute on their own, they require a calling function.
[TRUE]

2.6 Recursive call is not allowed for main() function.
[FALSE]

2.7 A structure cannot contain the structure itself as its member.
[FALSE]

2.8 Pointers to pointers is a term used to describe pointer whose contents are the address of another pointer.
[TRUE]

2.9 In C, there is a function name strcat () used to concatenate two strings.
[TRUE]

2.10 Values of predefined macros can be printed using printf statements in C program.
[TRUE]

                                                      Q.3. Match words and phrases


SR NO.
X
Y(Ans.)
1
Keyword used to transfer control form a function back to the calling function
2
Statement used to go to the next iteration in a loop
3
Library function used to clear the specified buffer
4
Relational operators cannot be used on
5
Function that allocate and clear allocated memory
6
If you have to use many if –else conditions, they can be usually implemented by
7
A price of information passed to a method
8
Function that all allocates memory but does not clear allocated memory
9
Function used for file pointer movement
10
Unending loop if no break statement inside the body


Q.4. Fill in the blank

4.1 C language is well suited for ______[J]______ programming.

4.2 An ___[H]____ storage class can be used to declare global variable known to all the functions in the file.

4.3 ___[M]____ function can be used to read a single character.

4.4 The operator “++” is known as __[G]____ operator .

4.5 The______[F]______ operator can be used to allocate memory space dynamically to variables during execution of a program.

4.6 A_____[K]______ variable points to another pointer.

4.7 A function with no return type is declare as [D].

4.8 A function prototype is always terminated by ___[E]_____ sign.

4.9 When a structure is passed to a function, then it should pass by____[L]_______.

4.10 The conditional operator (?:) is a ____[A]________ operator.

Options.
A. Router
B. Telnet
C. Half-Duplex
D. 27
E. Arpanet
F. Design
G. XHTML
H. Switch
I. Website
J. DHTML
K. 25
L. Code
M. FTP
Long Questions

(Answer any four questions)
Q.5. 
a) What do you mean by pre-processor directives? List and explain its different categories.
b) List out the advantage of functions in C. Also write a function to find second largest number form 1D array of n number.
c) What is the recursive function ? List out their merits and demerits. Also write a C program to calculate factorial of a number using recursion.
(5+5+5=15) 

Q.6.
(a) Write a C Program using function to print equivalent binary number of decimal number input by keyboard.
(b) What do you mean by algorithm ? Also write the algorithm to find multiplication of two matrices.
(c) Differentiate between the following : (i) Function definition and function declaration (ii) Actual parameter and formal parameter
(5+5+5=15) 

Q.7.
(a) Write a C Program to print and count all numbers between 1 to 100 divisible by 11.
(b) What is difference between pass by value and pass by reference with example ?
(c) Write a C program to swap values of two variables without using temporary variable.
(5+5+5=15)

Q.8.
(a) Write a C language program to copy the contents of one file to another file.
(b) What is command line argument ? Give example through ‘C’ program.
(c) What do you understand by ‘pointer to function’ ? Explain it using an example.
(5+5+5=15)


Q.9.
(a) What do you mean by linked list ? Write a function in C to delete a node at particular position from linked list.
(b) Differentiate between do-while loop and while loop with the help of one example for each.
(10+5=15)



0/Post a Comment/Comments

Leave a Reply

Previous Post Next Post