IP Model Paper
IP Model Paper
Introduction to Programming
(Common to all Branches)
PART –A
I What is the time complexity of an algorithm? L CO [2M]
1 1
II What is the difference between a variable and a constant in programming? L CO [2M]
1 1
III Write the syntax of do while in C. L CO [2M]
1 2
1 IV Write a C program to find the greater of two numbers. L CO [2M]
1 2
V Define String? Write the syntax for declaring a string? L CO [2M]
1 3
VI Briefly discuss the initialization of strings in ‘C’? L CO [2M]
2 3
VII What is pointer dereferencing? L CO [2M]
1 4
VII What are user defined data types? L CO [2M]
I 1 4
IX What is the scope and lifetime of the variable? L CO [2M]
1 5
X Briefly discuss the modes for opening binary files? L CO [2M]
1 5
PART –B
UNIT – I
What are the primary data types in the C programming language and what L CO [5M]
2(a) I
is the size and range of each data type? 2 1
II What is type conversion? Explain two types of conversion with examples. [5M]
OR
2(b) I What is an algorithm? Explain the different characteristics of an algorithm. L CO [5M]
4 1
II Distinguish between bottom-up and top-down approaches. [5M]
UNIT – II
3(a) I Explain the following conditional statements with an example. L CO [6M]
a) if-else b) switch 2 2
II Write a C program to find the roots of the quadratic equation. L CO [5M]
2 2
OR
What is the purpose of the break statement in C? Provide an L CO [6M]
3(b) I 2 2
example of a loop where the break statement is used.
Write a C program to find if the given year is a leap year or not. L CO [4M]
II
4 2
UNIT – III
I Explain the array indexing in the C language? L CO [5M]
4(a)
2 3
II Write a C Program to find the min and max element of a 1-D integer array. L CO [5M]
2 3
OR
Explain how to declare and initialize a two-dimensional array with an L CO [6M]
4(b) I
example program? 2 3
Write a C program to perform multiplication in between two matrices? L CO [4M]
II
4 3
UNIT – IV
5(a) I How do you declare a pointer in C language? Explain the syntax with an L CO [6M]
example? 1 4
II Write a C function to find the length of a string? L CO [4M]
4 4
OR
5(b) I Differentiate between structures and unions in C language? L CO [5M]
3 4
II Write a C program to copy one structure variable to another structure of L CO [5M]
the same type. 4 4
UNIT – V
6 (a) I Define user defined function? Explain about function declaration, function L CO [5M]
call and function definition? 3 5
II Write a C function that accepts two integers as parameters and returns their L CO [5M]
sum? 4 5
OR
I Discuss the steps involved in opening, reading, and closing a file in C. L CO [5M]
6(b) 3 5
II Write a C program to write and read text into a file. L CO [5M]
3 5
*****