0% found this document useful (0 votes)
98 views2 pages

CP Question Paper

Uploaded by

anubavroshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views2 pages

CP Question Paper

Uploaded by

anubavroshan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PUDUCHERRY TECHNOLOGICAL UNIVERSITY

PUDUCHERRY

B.Tech DEGREE EXAMINATION- MAY/JUNE 2022


COMMON TO ALL BRANCHES

SECOND SEMESTER
CS 201- Programming for Problem Solving
Time: Three Hours Max. Marks: 60
PartA - Answer ALL Questions. 5 x 2 = 10 Marks
No. Question
i. Outline the building blocks of algorithms
ii.
What are unary operators? List the unary operators in C language.
Show the output of the program
#include<stdio.h>
void main(){
lii.
int i, x[5] = {10, 20, 30, 40, 50}
for(i = 0; i < 5; i4+)
printf("%d" x[i]+i[x]); }
iv. Distinguish between structure and union.
v. Compare macro and function in C language
Part B - Answer ALL Questions. 5x8 Marks
No Question Marks
1. What is software? Explain the classificationsof software in detail. 5
b. What •is pseuocode? Write pseudo code to find the roots of the quadratic 3
equation.
OR
2. a. Explain the functional components and their interactions of a digital 5
computer with block diagram.
b. Compare the features of first, second and third generation programming 3
languages.

3. a. What is C token? Explain different types OfC tokens. 4


b. What is conditional operator? Develop a C program to find the maximum
4
of three numbers using conditional operator.
OR
4. a. Show the syntax of switch case statement and demonstrate with suitable
4
example.
b. Develop a C program to find the sum Of all integer numbers between 100
4
and 200 which are divisible by 5 and 7.
5. a. 5
Explain the storage classes in C language each with an example.
b. 3
Write C program to count occurrences Ofa given character in string.
OR
6. a. Illustrate the different ways to pass argumentsto a function each with
example. 5

What is recursive function? Demonstrate with an example. 3

7. a. What is the purpose of the typedeffeature and how is this feature used in
structure declaration? 3

b. What is pointer to structure? Illustrate how to accessmembers of structure using


5
pointer in C with an example.
OR
8 a. What is structure? With an example, explain how a structure is declared 4
and initialized.
b. Write a C program to find the maximum and minimum value in an integer 4
array of size N using pointers.

9.
Explain various functions for dynamic memory allocation in C language. 5
Outline various file modes in C language. 3
OR
10 a. What is conditional compilation? Illusyate complier control directives with 4
suitable example—
b. What are command line arguments?Write C program to find the minimum
of three integer number using command line arguments. 4

Part C 1 x 10 =10 Marks

No Question Marks
ll. List various functions in C language for file operations. 2
b. Develop C program for the following: 8
Declare a structure which will contain the following details about the
faculty of a technological university:
Faculty hame, id, department, designation, specialization and
length of
service. Using this structure store details about N number of
faculty in a
file named "Faculty.dat".
Use the above file and list all the faculty of the given
department.
OR
12. a.
What is the relationship between pointers and arrays in C?
2
b. Develop C program for the following:
Create a structure called "time" with three integer
members hours, minutes
and seconds. Define a function called "add time"
to add two time values
stored in the time structures passed by reference
and return a time structure 8
corresponding to the result. i.e addition of two given times.
Call the
add_time function in the main function and display
result along with
given input time values. the

You might also like