Roll No. …………………..
TCS–101
B. Tech. (First Semester)
EXAMINATION, 2024-25
PROGRAMMING FOR PROBLEM SOLVING
Time : Three Hours
Maximum Marks : 60
Note : Question paper has three Section. Read carefully
instructions for each section.
Section—A
(Very Short Answer Type Questions)
1. Attempt all questions. 1 each
(a) List any five pre-processor directives in C.
(CO1, UN)
(b) Give the name of formatted input and output
statement with examples. (CO2, AN)
(c) Briefly define role of cache memory.
(CO1, UN)
P. T. O.
[2] TCS–101
(d) Differentiate between user define and library
functions. (CO3, RE)
(e) Define use of typedef () in C programming.
(CO2, RE)
(f) List the properties of command line argument
in C programming. (CO2, AN)
(g) Least at least any ten keywords used in C
language. (CO1, UN)
(h) int main() (CO1, AN)
{
int a=4;
printf(“%d”,++(a);
printf(“%d”,a--) ;
return 0;}
analyse the output of this code.
(i) Briefly explain the use of “%u” and “%s”.
(CO1, RE)
(j) Define recursion/recursive function.
(CO3, AN)
(k) Differentiate between #define and #include.
(CO5, RE)
[3] TCS–101
(l) Explain very briefly union ? How is it
different from structure ? (CO4, RE)
Section—B
(Short Answer Type Questions)
2. Attempt all questions. 4 each
(a) Define Computer Hardware and Software.
Explain different types of software with
suitable example of each. (CO1, UN)
OR
Explain typecasting C programming. Also
discuss the different types of typecasting in C
language with suitable example. (CO1, AP)
(b) Give the storage, initial value, scope and life
time of the following : (CO2, AN)
(i) External variable
(ii) Static variable
(iii) Automatic variable
(iv) Register variable
P. T. O.
[4] TCS–101
OR
Discuss the role of flowchart and algorithm
in C programming language with suitable
example. (CO2, AN)
(c) Differentiate between call by value and call
by reference with examples. Write a C
program to swap two numbers using call by
address (pointers or reference) method.
(CO1, RE)
OR
Perform the following conversion :
(i) (2983.146)10 = (?)8
(ii) (14667)8 = (?)16
(iii) (10011.11)2 = (?)8
(iv) (49978.81)10 = (?)16
(d) Define array. How a single dimension and
two-dimension arrays are declared and
initialized ? Write a program to convert
decimal number in to binary number.
(CO5, AN)
[5] TCS–101
OR
Discuss about file and file organization.
Explain file handling functions. (CO5, AN)
(e) List the differences between while loop and
do-while loop. Write a C program to find sum
of Natural numbers from 1 to N using for
loop. (CO2, AP)
OR
Show how break and continue statements are
used in a C-program, with example.
(CO2, AP)
(f) With a neat diagram explain the basic
structure of a computer system. (CO1, AP)
OR
Write an algorithm and draw a flowchart for
the problem statement to find out largest
number among three numbers. (CO1, AP)
Section—C
(Long Answer Type Questions)
3. Attempt all questions. 8 each
(a) What is function ? Explain different
classification functions. Write a C-program
P. T. O.
[6] TCS–101
using functions to generate the Fibonacci
series. (CO5, AN)
OR
Differentiate between static memory
allocation and dynamic memory allocation.
Also explain the role of all malloc(), calloc()
realloc() and free(). (CO5, AN)
(b) Explain different categories of pre-processor
directives used in C. Write a program to print
the sum of the following series : (CO2, AP)
11/2 + 21/2 + 31/2 + 41/2 .......... n.
OR
Explain string manipulation library functions
with their syntaxes. Write a program to check
whether a string is palindrome or not.
(CO2, AP)
(c) Write a C program that takes from user an
arithmetic operator (,,+ “,”–“, ,,*“, or ,,/“) and
two operands. Perform corresponding
arithmetic operation on the operands using
switch statement. (CO4, AN)
[7] TCS–101
OR
Write a C program that takes three
coefficients (a, b and c) of a quadratic
equation (ax2 + bx + c) as input and compute
all possible roots and print them with
appropriate messages. (CO4, AN)
TCS–101
P. T. O.