Introduction to Programming2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

H.T.No.

Code No: CT4501 SRGEC-R23


I B.Tech I Semester Supplementary Examinations, July 2024
INTRODUCTION TO PROGRAMMING
(Common to All Branches)
Time: 3 Hours Max. Marks: 70
Note: All questions from PART-A are to be answered at one place.
Answer one question from each unit of PART-B. All questions carry equal marks.

PART-A
10 × 2 = 20M
1. a) What does space complexity measure in algorithm analysis?
b) Define algorithm and flowchart.
c) Write the syntax of for loop. How to make for loop as infinite loop? Give an example.
d) In what scenarios is a switch statement more appropriate than a series of if-else
statements?
e) Define a string in the context of programming.
f) Write the syntax for strcpy().Give an example.
g) How to initialize a Pointer. Explain with an example.
h) Differentiate member and variable name in a structure with an example.
i) Explain Function Declaration with proper syntax and example.
j) Write the syntax for fopen( ) and fclose( ) in C?

PART-B
5 × 10 = 50M

UNIT-I
2. a) Describe the divide and conquer paradigm, providing examples of algorithms that follow
this approach. (6M)
b) Draw a flow chart to perform addition of two numbers. (4M)
(OR)
3. a) What is a compiler? Explain how the programs are executed in C language. (5M)
b) Write a C program to compute the perimeter and area of a rectangle with a height of 7
inches and width of 5 inches. (5M)
UNIT-II
4. a) Write a C program to display multiplication table of n using for loop. (5M)
b) Implement C code to find out the roots of the quadratic equation. (5M)

Page 1 of 2
(OR)
5. a) What is the use of break statement? How it is used in switch case? Explain. (5M)
b) Write a C program to display numbers from 10 to 1 (5M)
UNIT-III
6. a) Write a C Program to sort list of names in ascending order. (5M)
b) Show that any two dimensional array is collection of one dimensional arrays with an
example. (5M)
(OR)
7. a) How multi dimensional arrays can be declared and initialized ? provide syntax and give an
example. (5M)
b) Write a C program to read ‘n’ integers from the user and display them in reverse order.
(For ex:input:23,56,67 Output:67,56,23) (5M)
UNIT-IV
8. a) Explain how to declare the structure with proper syntax. (5M)
b) Compare the Structure and Union in different aspects. (5M)
(OR)
9. a) Write a C program to read an array of integers. Instead of using indexes, however, use an
integer pointer that points to the elements currently being read in, and which is
incremented every time. (5M)
b) Analyze the similarities and dissimilarities between array of structures and array within
structures in C. (5M)
UNIT-V
10. a) List the types of files. Explain them in detail. (5M)
b) Explain the File opening modes in C. (5M)
(OR)
11. a) Write a C program to swap two numbers using call by value and call by reference. (5M)
b) Explain the Function call Return Types and Arguments. (5M)

*****

Page 2 of 2

You might also like