Code No: R201110 R20 SET - 1
I B. Tech I Semester Regular Examinations, April - 2022
PROGRAMMING FOR PROBLEM SOLVING USING C
(Common to EEE, ME, ECE, CSE, CSE-CS&T, EIE, IT, ECT, Auto Eng, Min Eng, Pet Eng, CSE-AI&ML, CSE-AI,
CSE-DS, CSE-AI&DS, CSE-CS, CSE-IOT &CS Incl BCT, CSE-CS & BS, CSE-IOT, Food Eng, AI&DS)
Time: 3 hours Max. Marks: 70
Answer any five Questions one Question from Each Unit
All Questions Carry Equal Marks
UNIT I
1. a) Write the importance of precedence and associativity? Write the table for operator (7M)
precedence?
b) What is meant by type conversion? Why is necessary? Explain about implicit and (7M)
explicit type conversion with examples.
Or
2. a) How does a control string in a printf() function differ from the controlstring in a (7M)
scanf() function.? Write commonly used scanf() format codes.
b) How are signed and unsigned integers stored? Explain with an example. (7M)
UNIT II
3. a) Explain arithmetic, logical and bitwise operators with examples. (7M)
b) Differentiate between entry- control and exit-control loops with an example. (7M)
Or
4. a) Demonstrate the various control statements available in ’C’? (7M)
b) Develop a C program for printing the following pattern on the screen. (7M)
*
* *
* * *
* * * *
UNIT III
5. a) What is an array? How to store elements in an array? (7M)
b) Develop a C program to count sum of even numbers in a given array. (7M)
Or
6. a) Define string? Explain about string operations with examples. (7M)
b) Develop a C program to find the length of the Given string without using (7M)
predefined functions.
UNIT IV
7. a) What is dynamic memory allocation and explain the Difference between malloc() (7M)
and calloc().
b) Develop a C program using pointers to compute the sum of all elements stored in (7M)
an array.
Or
8. a) What is address arithmetic in C? Explain different arithmetic operations that can (7M)
be performed on pointers.
b) In detail explain the pointers and arrays of 2D and 3D with suitable examples. (7M)
UNIT V
9. a) Differentiate the call by value and call by reference mechanism with examples. (7M)
b) Using recursion write a C program to find the GCD of two numbers (7M)
Or
10 a) What kind of files and functions for files are used in C language? Explain in detail (7M)
b) Write the recursive function to find the solution to towers of Hanoi problem. (7M)
|''|''|||''|'''|||'| 1 of 1
Code No: R201110 R20 SET - 2
I B. Tech I Semester Regular Examinations, April - 2022
PROGRAMMING FOR PROBLEM SOLVING USING C
(Common to EEE, ME, ECE, CSE, CSE-CS&T, EIE, IT, ECT, Auto Eng, Min Eng, Pet Eng, CSE-AI&ML, CSE-AI,
CSE-DS, CSE-AI&DS, CSE-CS, CSE-IOT &CS Incl BCT, CSE-CS & BS, CSE-IOT, Food Eng, AI&DS)
Time: 3 hours Max. Marks: 70
Answer any five Questions one Question from Each Unit
All Questions Carry Equal Marks
UNIT I
1. a) Describe the purpose of the qualifiers constant, identifiers, keywords and volatile (7M)
with example.
b) What is scope of variable? Explain block scope, function scope, program scope (7M)
and file scope with an example program.
Or
2. a) Describe briefly the numbering system used in computers. Explain with suitable (7M)
examples.
b) Illustrate the various storage classes used in C program. Explain each with a (7M)
simple program.
UNIT II
3. a) Write a program to evaluate the power series (7M)
ex = 1 + x + x2/2! + x3/3! + ....... + xn/n!, 0 <x <1 using if …else.
b) What are bit-fields.? Explain their significance. (7M)
Or
4. a) Compare the following pairs of statements: (7M)
(i) Switch and nested-if-else statement
(ii) (ii) Break and Continue
(iii) go to and Continue.
b) Explain the concepts of multi way selection. And write a program to determine (7M)
whether an entered character is vowel or not.
UNIT III
5. a) Write a C program to reverse the contents of an integer array without using (7M)
another array.
b) Define structures in C. How are they different from unions? Give an example for (7M)
structure.
Or
6. a) Explain the utility of ‘typedef’ keyword. Write a program to illustrate it. (7M)
b) Write a C program to interchange the largest and smallest elements in an array. (7M)
UNIT IV
7. a) How are generic pointers different from pointer variables and also differentiate (7M)
ptr++ and ++ptr.
b) Write a C program to convert floating point number into integer using pointers. (7M)
Or
1 of 2
|''|''|||''|'''|||'|
Code No: R201110 R20 SET - 2
8. a) What is the role of L value and R Value in pointer arithmetic? Explain in detail. (7M)
b) Using pointers in functions write a C program to perform arithmetic operations on (7M)
two integers.
UNIT V
9. a) Write a program to calculate factorial of a number with recursion and without (7M)
recursion.
b) Explain the following with respect to functions: (7M)
(i) Function prototype (ii) Function call (iii) Returning from function
Or
10 a) What do you mean by streams? What are the applications of it? Differentiate text (7M)
. and binary streams.
b) What are various standard library input/output functions used in C language? (7M)
Explain with simple program.
2 of 2
|''|''|||''|'''|||'|
Code No: R201110 R20
1 of 1 SET - 3
I B. Tech I Semester Regular Examinations, April - 2022
PROGRAMMING FOR PROBLEM SOLVING USING C
(Common to EEE, ME, ECE, CSE, CSE-CS&T, EIE, IT, ECT, Auto Eng, Min Eng, Pet Eng, CSE-AI&ML, CSE-AI,
CSE-DS, CSE-AI&DS, CSE-CS, CSE-IOT &CS Incl BCT, CSE-CS & BS, CSE-IOT, Food Eng, AI&DS)
Time: 3 hours Max. Marks: 70
Answer any five Questions one Question from Each Unit
All Questions Carry Equal Marks
--------------------------------------------------------------------------------------------------------
UNIT I
1. a) Define variable? What are the rules for declaring the variables? (7M)
b) Explain about printf (), scanf() functions in C programming language. (7M)
Or
2. a) What do you mean by Expression? Evaluate the following expressions : (7M)
(i) 5/3*3 – 8%5 *2 +6*3/9 (ii) 9/4*2 + 5%8*3-5*4/2
b) Write a short notes on i) data types ii) storage classes iii) Identifiers (7M)
UNIT II
3. a) Write a complete C program to find the roots of a quadratic equation using if (7M)
statement.
b) Write a C program to Check whether the given number is odd or even, using the (7M)
ternary operator.
Or
4. a) Write a C program to read the principal amount, period of deposit and rate of (7M)
interest. The program should compute the simple interest rounding to nearest
rupee without using if statements and built-in functions.
b) Develop a C program to print Floyd triangle. (7M)
UNIT III
5. a) What are the unions? How are they different from structures? Give an example for (7M)
union.
b) Explain built-in functions for handling strings. (7M)
Or
6. a) Develop a C program to multiply two ‘m × n’ matrices. Cover all necessary (7M)
conditions
b) What is string palindrome? Develop a program to check whether the given stringis (7M)
palindrome or not?
UNIT IV
7. a) What is a pointer variable? How is a pointer variable different from an ordinary (7M)
Variable?
b) Develop a C program using pointers to compute the sum of all elements stored in (7M)
an array.
Or
8. a) How to pass pointer variables as function arguments? Explain with examples. (7M)
b) Develop a C Program to Access Elements of an Array Using Pointer. (7M)
1 of 2
|''|''|||''|'''|||'|
SET - 3
Code No: R201110 R20
UNIT V
9. a) Develop a program to find the factorial of a given integer number using recursive (7M)
function.
b) What is the difference between call by value and call by reference? Discuss the (7M)
problems associated with each.
Or
10 a) Explain how to pass one dimensional arrays to functions. (7M)
b) Develop a C program to append the contents of one file to another file. (7M)
2of 2
|''|''|||''|'''|||'|
Code No: R201110 R20 SET - 4
I B. Tech I Semester Regular Examinations, April - 2022
PROGRAMMING FOR PROBLEM SOLVING USING C
(Common to EEE, ME, ECE, CSE, CSE-CS&T, EIE, IT, ECT, Auto Eng, Min Eng, Pet Eng, CSE-AI&ML, CSE-AI,
CSE-DS, CSE-AI&DS, CSE-CS, CSE-IOT &CS Incl BCT, CSE-CS & BS, CSE-IOT, Food Eng, AI&DS)
Time: 3 hours Max. Marks: 70
Answer any five Questions one Question from Each Unit
All Questions Carry Equal Marks
UNIT I
1. a) Explain the basic structure of C program and explain the significance of each (7M)
section.
b) Write the steps in creating and running of a c program. (7M)
Or
2. a) Explain the following with examples (7M)
(i) Constants and types of constants
(ii) Variables and rules for naming variables.
b) List out the various category of operators available in c? Give examples. (7M)
UNIT II
3. a) Write a note on (7M)
(i) Bitwise operator (ii) Conditional operator
(iii) Size ofoperator (iv) logical operators.
b) Write a C program and draw flowchart to count the number of digits and sum of (7M)
digits in a given integer value.
Or
4. a) Write a C program to find number of primes between integers m and n (m < n).Also (7M)
print the prime numbers.
b) What is the purpose of a “FOR” statement? Minimum how many times a for loop (7M)
will be executed? Compare FOR with WHILE and DO-WHILE statements.
UNIT III
5. a) Create a structure of employees having the following information: Employee id, (7M)
Employee name, Date of joining, Salary.
Write a C program to input information of 20 employees and display the details of
the specified employee given the employee id.
b) Write a C program to check whether a given string is palindrome or not.(without (7M)
using any built-in string function).
Or
6. a) What are subscripted variables? How one and two dimensional subscripted variables (7M)
(arrays) are declared?
b) Write a C program to compare two strings without using string handling functions. (7M)
UNIT IV
7. a) What are the advantages of using array name as a pointer? (7M)
b) Write a program using pointer to swap two numbers. (7M)
Or
1 of 2
|''|''|||''|'''|||'|
Code No: R201110 R20 SET - 4
8. a) Explain pointers to functions and array of pointers. (7M)
b) Write a program to find sum and average of elements stored in an array, using (7M)
Pointers.
UNIT V
9. a) What are functions? How are they useful? What are the different kinds of (7M)
userdefined functions and what is the need of user defined functions?
b) Develop a program to find the given number is prime or not using functions. (7M)
Or
10. a) Write a program that copies the content of one file into another. (7M)
b) What do you mean by command-line arguments? Give an example program. (7M)
2 of 2
|''|''|||''|'''|||'|