Problem-Solving Through Programming: First/Second Semester B.E. Degree Examination
Problem-Solving Through Programming: First/Second Semester B.E. Degree Examination
Note: 01. Answer any FIVE full questions, choosing at least ONE question from each MODULE.
02. Use C code snippet to illustrate a specific code design or a purpose.
Module -1 Marks
Q.01 a Define Computer. Broadly classify the computers based on their Speed, Storage and 7
Price.
b Classify the following into application or system software and justify. 8
i. C Compiler ii.Word-processor iii.Web-browser iv.Operating system
c List any three input and three output devices of a computer and explain any one 5
each.
OR
Q.02 a List the basic data types available in C. Explain with example. 8
b What is typecasting? Mention its use with a suitable example 5
c Write a C program to swap two integers without using temporary variable 7
Module-2
Q. 03 a Explain the syntax and working of switch case statement. Mention in which situation 7
it is desirable.
b Write the output of the following C code: 3
int n=0, m;
for(m=1;m<=n+1;m++)
printf(“%d %d”,++m, m++);
c Compare the working of for, while and do..while along with their syntax. 10
OR
Q.04 a Write a C program to compute the roots of a quadratic equation by accepting the 8
coefficients and print the appropriate message along with the values.
b Explain the working of goto statement in C programming 6
c Give the syntax and working of simple if..else 6
Module-3
Q. 05 a How 1Dimension integer array is represented in memory? with the help of suitable 6
example demonstrate the initializing the array elements
b Write a C program to transpose a m x n matrix 6
c With the help of suitable example explain the working of Binary Search technique 8
OR
Q. 06 a Write a C program to implement Selection Sort technique (ascending order). Trace 10
the steps for the input: 9, 1, 6, 3, 2, 0, 5
b Using suitable code, discuss the working of the following string functions: 10
i.strcat ii.strcmp iii.strcpy iv.strlen v.strstr
Module-4
Q. 07 a Discuss the implementation of user-defined function with a suitable example 8
b What is Recursion? Discuss its working with the help of a suitable example 5
c Write a C function that can be called to find the largest element of an integer array of 7
size n
OR
Q. 08 a Discuss the various ways of passing parameter to the functions 8
b Write a C program to find factorial of a given number using recursion function. 7
c List any five built-in functions and explain any two of them. 5
Page 01 of 03
Subject Code-21PSP23/13
Module-5
Q. 09 a Write a C program to swap two integer values using pointers 5
b Give the general syntax to initialize a structure to store a Book information 7
c How union is different from struct? Give example 8
OR
Q. 10 a Discuss the use of #define and #include in C programming 8
b Give the syntax for declaring and initializing a union with a suitable example 5
c When we need Self-referential structure? Discuss its implementation 7
Page 02 of 03