0% found this document useful (0 votes)
6 views

APR 2022 Programming For Problem Solving

Uploaded by

Venkata satish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

APR 2022 Programming For Problem Solving

Uploaded by

Venkata satish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

H.T.No.

Code No: CT3502 SRGEC-R20


I B.Tech I Semester Regular/Supplementary Examinations, April 2022
PROGRAMMING FOR PROBLEM SOLVING
(Computer Science and Engineering, Artificial Intelligence and Data Science, Artificial
Intelligence and Machine Learning & Information Technology)
Time: 3 Hours Max. Marks: 70
Note: Answer one question from each unit.
All questions carry equal marks.
5 × 14 = 70M
UNIT-I
1. a) Identify different types of errors in C. (6M)
b) Draw a flowchart to find the roots a of quadratic equation. (8M)
(OR)
2. a) Differentiate between identifier and variable. (6M)
b) Write a C program to illustrate the usage of Bitwise Operators. (8M)
UNIT-II
3. a) Write a C program to Display the n terms of harmonic series and their sum.
1 + 1/2 + 1/3 + 1/4 + 1/5 +...+ 1/n terms. (6M)
b) Develop C code to check whether given number is Strong number or not. (8M)
(Strong Number: 145=1!+4!+5!=145)
(OR)
4. a) Explain Nested Switch statements with suitable example program. (8M)
b) Write a C program that prompts the user to input number of calls and calculate the
monthly telephone bills as per the following rule: (6M)
Minimum Rs. 200 for up to 100 calls.
Plus Rs. 0.60 per call for next 50 calls.
Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.
UNIT-III
5. a) Define String.Explain with suitable example program to read and print the string variable.
(6M)
b) Write a C Program to insert sub-string into main string at specified position. (8M)
(OR)
6. a) Can we use 2-dimensional array for storing array of names?if yes, justify with suitable
example program. (6M)
b) Write a C Program to sort list of names in ascending order. (8M)

Page 1 of 2
UNIT-IV
7. a) Differentiate between malloc() and calloc(). (6M)
b) Write a C Program to find sum of n elements entered by user. To perform this program,
allocate memory dynamically using malloc() function. (8M)
(OR)
8. Write a C Program to create a function that receives two integers and passes back the greatest
common divisor. The calculation of greatest common divisor can be done using Euclid
method of repetitively dividing one number by the other and using the remainder (modulo).
When the remainder is zero, the gcd has been found. Once you know the gcd the least
common multiplier is determined by (14M)
𝑛𝑢𝑚 1∗𝑛𝑢𝑚 2
lcm=
gcd ⁡
(𝑛𝑢𝑚 1,𝑛𝑢𝑚 2)

UNIT-V
9. a) Explain arrays of structures with suitable example program. (7M)
b) Develop a C program to create a structure for employee which includes details such as
empno, DOB(dd-mm-yyyy) and salary. Use this structure for ‘n’ employees. Read the the
data of each employee from the user and display them. (7M)
(OR)
10. What are various operations that can be performed on files? Explain each operation with
syntax and example. (14M)

*****

Page 2 of 2

You might also like