INTRODUCTION-TO-PROGRAMMING-JAN-2024 [www.jntumaterials.co.in]
INTRODUCTION-TO-PROGRAMMING-JAN-2024 [www.jntumaterials.co.in]
in
Code No: R231107 R23 SET - 1
UNIT-IV
8. a) Explain Pointer Arithmetic with suitable example. [5M]
b) Explain about declaration, initialization and accessing of structures. And also [5M]
discuss about complex structures.
(OR)
9. a) Write a C program to sort an array using pointers. [5M]
b) Explain the concepts used in the given program and write the output. [5M]
main() {
int m[2]={100,200};
int a,b,c,*p=m; a=*p;
b=*(p+1); c=(*p+1);
printf("%d %d %d", a,b,c);
}
UNIT-V
10. a) Write a C program to copy the contents of a text file to another file. Pass the [5M]
filename using command line arguments.
b) Differentiate the call by value and call by reference mechanism with examples. [5M]
(OR)
11. a) Develop a C program to find sum of ‘n’ Elements entered by user. To perform this [5M]
program, allocate memory dynamically Using malloc() function.
b) How do you define the scope of a variable? Illustrate with a Program. [5M]
*****
2 of 2
|'''|'|'|''||'''||||
www.jntumaterials.co.in
Code No: R231107 R23 SET - 2
UNIT-II
4. a) Develop a program to check whether the given number is prime number or not. [5M]
b) Differentiate between counter control and conditional control statements in C. [5M]
(OR)
5. a) Develop a program that asks user an arithmetic operator (‘+’, ‘-‘, ‘*’ or ‘/’) and two [5M]
operands and perform the corresponding calculation on the operands. Use a switch
statement.
b) How does a switch statement works? List the difference between switch and if else [5M]
ladder statement.
1 of 2
|'''|'|'|''||'''||||
www.jntumaterials.co.in
Code No: R231107 R23 SET - 2
UNIT-III
6. a) Develop program to find the average of smallest and largest numbers in a given array. [5M]
b) What is string palindrome? Develop a program to check whether the given string is [5M]
palindrome or not.
(OR)
7. a) Develop a program to search the key element in the given list. [5M]
b) Develop a program to implement string operations by using string handling functions. [5M]
UNIT-IV
8. a) Develop a C program to swap two numbers using pointers. [5M]
b) What is a pointer variable? How is a pointer variable different from an ordinary [5M]
Variable?
(OR)
9. a) How to pass pointer variables as function arguments? Explain with examples. [5M]
b) Develop a C program to declare a structure with the following elements and for [5M]
accessing them. 1. Name. 2. Age. 3. University.
UNIT-V
10. a) Define dynamic memory. Describe the functions to allocate dynamic memory. [5M]
b) What is a File? Explain fopen() and fclose() functions with suitable examples. [5M]
(OR)
11. a) Develop a program to calculate the factorial of a given number using recursion. [5M]
b) Write a note on File and briefly explain various operations on files with examples. [5M]
*****
2 of 2
|'''|'|'|''||'''||||
www.jntumaterials.co.in
Code No: R231107 R23 SET - 3
(OR)
3 a) Write a program to find the factorial of a given number and analyze its time [5M]
complexity.
b) Explain about relational and logical operators and write a C program by using these [5M]
operators.
UNIT-II
4. a) Write about nested for loop statement with examples. [5M]
b) Write program to check whether the given integer is palindrome or not by using for [5M]
loop.
(OR)
5. a) What are selection statements? What is the necessity of selection statements? Explain. [5M]
b) Develop a C program to check whether a number entered by user is even or odd. Use [5M]
if else statement.
UNIT-III
6. a) Develop a program to count sum of even numbers in a given array. [5M]
b) Develop a program to append the one string to another string without using predefined [5M]
functions.
1 of 2
|'''|'|'|''||'''||||
www.jntumaterials.co.in
(OR)
7. a) Write the concepts of arrays and illustrate different dimensions defined on array with [5M]
example.
b) Develop a C program to multiply two ‘m × n’ matrices. Cover all necessary [5M]
conditions.
UNIT-IV
8. a) Define Structure? Explain how to declare a structure, accessing structure members [5M]
with an example program.
b) Explain the array of pointers with example. [5M]
(OR)
9. a) Develop a program using pointers to read in an array of integers and print its elements [5M]
in reverse order.
b) Define the union and write a program to declare and access the union members. [5M]
Consider employee details as an example.
UNIT-V
10. a) Develop a C program to count the number of characters in a file. [5M]
b) What is the difference between iterative and recursive functions. Explain with finding [5M]
factorial.
(OR)
11. a) Illustrate the concepts of functions calls and return types. [5M]
b) Define File? Briefly explain various operations on files with examples. [5M]
*****
2 of 2
|'''|'|'|''||'''||||
www.jntumaterials.co.in
Code No: R231107 R23 SET - 4
(OR)
3 a) Explain about Compiler, Interpreter, and Assembler. [5M]
b) Define variable? What are the rules for declaring the variables? [5M]
UNIT-II
4. a) Differentiate between While and do-While loops with an example. [5M]
b) Develop a program to calculate the sum of digits in a given number by using while [5M]
loop.
(OR)
5. a) Differentiate the conditional operator with if else statement. Explain with the help of [5M]
an example.
b) Illustrate the use of special control constructs goto, break, continue and return. [5M]
UNIT-III
6. a) Write a C program to calculate the sum and difference of two 2-dimensional Matrices. [5M]
b) Explain the following string handling functions: [5M]
(i) strcpy( ) (ii) strlen( ) (iii)strcat( ) (iv) strcmp( )
1 of 2
|'''|'|'|''||'''||||
www.jntumaterials.co.in
(OR)
7. a) Write a program to find second highest and smallest number in the given array. [5M]
b) Illustrate the string operations: i) Copying the string ii) Reversing the string iii) [5M]
Update the Characters in string iv) Finding the string length
UNIT-IV
8. a) List the difference between structures and unions. Explain with an example. [5M]
b) Write a program to show the subject registration for an exam by the student using [5M]
structures.
(OR)
9. a) Define a pointer in C language? Explain about NULL character. [5M]
b) How structure is different form an array? Explain with program. [5M]
UNIT-V
10. a) Distinguish user defined and predefined function. Explain with one example. [5M]
b) Develop a C program to append the contents of one file to another file. [5M]
(OR)
11. a) Develop a program to find the given number is prime or not using functions. [5M]
b) List out modes of operations to open a file. [5M]
*****
2 of 2
|'''|'|'|''||'''||||