Printed Page: 1 of 2
Subject Code: KCS201
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0
BTECH
(SEM II) THEORY EXAMINATION 2021-22
PROGRAMMING FOR PROBLEM SOLVING
Time: 3 Hours Total Marks: 100
Note: Attempt all Sections. If you require any missing data, then choose suitably.
SECTION A
1. Attempt all questions in brief. 2x10 = 20
Qno Questions CO
(a) What do you mean by command line arguments? 5
(b) Explain strlen() and strcpy() function with example. 4
(c) What do you mean by linked list? 5
(d) What do you mean by function prototype? 3
(e) Describe the use of logical AND and logical OR operators in C with 2
example.
(f) Write down the difference between syntax error and logical error. 1
(g) What is algorithm? Discuss its characteristics. 1
(h) Why we use do while loop in C? 3
(i) Differentiate between structure and union. 4
(j) Explain Bitwise operator with example. 2
SECTION B
2. Attempt any three of the following: 10x3 = 30
Qno Questions CO
(a) Explain Basic data type with their size and range and format specifier. 1
(b) Write a program to find the largest of three numbers using conditional 2
operator.
(c) Write a program to print the following pattern. 3
1
22
333
4444
(d) Write a program to store a record of 100 student like name, marks 4
and roll number and print using structure.
(e) Explain DMA along with their all function in detail. 5
SECTION C
3. Attempt any one part of the following: 10x1 = 10
Qno Questions CO
(a) What is operating System? Explain its type. 1
(b) What is meant by type conversion? Explain about implicit and 1
explicit type conversion with examples.
4. Attempt any one part of the following: 10x1 = 10
Qno Questions CO
(a) Write a Program to print the all prime numbers between 1 to 500. 2
(b) What do you mean by Operator precedence and operator 2
associativity?
Printed Page: 2 of 2
Subject Code: KCS201
0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0
BTECH
(SEM II) THEORY EXAMINATION 2021-22
PROGRAMMING FOR PROBLEM SOLVING
5. Attempt any one part of the following: 10x1 = 10
Qno Questions CO
(a) Write a program to find the sum of N natural number using recursion. 3
(b) What do you mean by call by value and call by reference? Write a 3
program to read two integers X and Y and swap the contents of the
two variables X & Y using pointers.
6. Attempt any one part of the following: 10x1 = 10
Qno Questions CO
(a) Write a program to find maximum and minimum element of an array. 4
(b) Write a program to find the number of vowels in a string. 4
7. Attempt any one part of the following: 10x1 = 10
Qno Questions CO
(a) Explain the role of C-pre-processor. What is Macro? And advantages 5
of using macro definitions in a program. Give an example.
(b) List out various file opening modes in C. Write a program to copy the 5
content from one file to another file.