You are on page 1of 9

P.V.

P SIDDHARTHA INSTITUTE OF TECHNOLOGY


BRANCH: Common to All Branches REGULATIONS : PVP23
Course: B. Tech SUBJECT : INTRODUCTION TO PROGRAMMING
Subject Code: 23ES1102 Year and Semester: I Year-I Sem
QUESTION BANK

UNIT I

Short Answer Questions (2 Marks Each)

Q.
QUESTION CO LEVEL MARKS
NO.
1 Classify primitive data types in C language. CO1 L2 2M
2 Outline time and space complexities of algorithms. CO1 L2 2M
3 Summarise the structure of C program. CO1 L2 2M
4 Describe algorithm and flow chart. CO1 L2 2M
5 Describe identifiers, variables, and constants? CO1 L2 2M
Summarise an algorithm to find the factorial of a given CO1 L2 2M
6
number.
7 Summarise the various basic data types in C language. CO1 L2 2M
8 Describe the Arithmetic operators with examples. CO1 L2 2M
Summarise an algorithm to find the largest of three CO1 L2 2M
9
numbers.
10 Describe type casting. CO1 L2 2M

Long Answer Questions (10 Marks Each)


(Can have Sub Questions also)

Q.
QUESTION CO LEVEL MARKS
NO.
a) Briefly explain the block diagram of a computer along
CO1 L2 5M
with a neat sketch.
1
b) Explain various characteristics of an algorithm. CO1 L2 5M

a) Summarize various generations of programming


languages. CO1 L2 5M
2
b) Outline a C program to calculate an average of given six
CO1 L2 5M
subjects marks.
a) Discuss in detail about the important characteristics of the
CO1 L2 5M
3 algorithm with suitable example.
b) Explain the functionality of CPU. CO1 L2 5M

a) Explain about variable declaration and initialization. CO1 L2 5M


4 b) List the naming rules of an identifier. Classify the
following as valid/invalid Identifiers. i) num2 ii) $num1 iii) CO1 L2 5M
+add iv) a_2 v) 199_space vi) _apple vii)#12
a) Explain about formatted input and output functions in C. CO1 L2 5M
5 b) Interpret type casting and type conversion in detail with
CO1 L2 5M
an example.
a) Compare pseudo-code and algorithm. CO1 L2 5M
6
b) List and explain various problem-solving strategies. CO1 L2 5M
a) Explain various symbols of flowchart with its usage. CO1 L2 5M
7
b) Explain Arithmetic operators with an example. CO1 L2 5M
a) Explain various types of software. CO1 L2 5M
8 b) Describe an algorithm to find the area and perimeter of a
CO1 L2 5M
circle.
a) Explain the basic structure of C program. CO1 L2 5M
9
b) Illustrate standard I/O functions in C programming. CO1 L2 5M
a) Interpret the output of the following expression using
CO1 L2 5M
operator precedence and associativity: 1+3^2*2-10/5
10
b) Explain the following operators with relevant examples:
CO1 L2 5M
i) Bitwise operators ii) Increment and Decrement operators

UNIT II
Short Answer Questions (2 Marks Each)

Q.
QUESTION CO LEVEL MARKS
NO.
1 Summarize conditional statements in C. CO1 L2 2M
2 Explain working of continue statement. CO1 L2 2M
3 Describe switch case statement with syntax. CO1 L2 2M
4 Describe two-way selection with an example. CO1 L2 2M
5 Differentiate break and continue with syntax and example. CO1 L2 2M
6 Explain about while loop. CO1 L2 2M
7 Describe for loop with an example. CO1 L2 2M
8 Describe do-while with suitable example. CO1 L2 2M
9 Compare while and do-while. CO1 L2 2M
10 Compare if-else-if with switch. CO1 L2 2M

Long Answer Questions (10 Marks Each)


(Can have Sub Questions also)

Q.
QUESTION CO LEVEL MARKS
NO.
a) Develop a C program to find the largest of three integers
CO2 L3 5M
using the ternary operator.
1
b) Write a C program to determine whether an entered
CO2 L3 5M
character is a vowel or not using switch statement.

a) Build a C program to check whether a given number is a


CO2 L3 5M
perfect number or not.
2
b) Develop a C program to reverse the digits of a given
positive integer using while loop. CO2 L3 5M
Example: Input: 123 Output: 321
a) Develop a program to find the average of six subjects and
display the
results as follows:
Average Result
>34 & <50 Third Division CO2 L3 5M
>49 & <60 Second Division
3
>=60 & <75 First division
>=75 & <=100 Distinction
If marks in any subject less than 35 Fail.
b) Build a calculator program in C language to do simple
operations like addition, subtraction, multiplication and CO2 L3 5M
division. Use switch statement in your program.
a) Develop a C program to find LCM of given numbers. CO2 L3 5M
4
b) Develop a C program to find GCD of given two numbers. CO2 L3 5M
a) Develop a program to print the following sequence of
CO2 L3 5M
numbers 1, 8, 27, 64……..
5
b) Develop a program to print multiplication tables from 1
CO2 L3 5M
to 10 except 3 and 5.
a) Develop a program to convert binary number to decimal. CO2 L3 5M
6 b) Develop a program to check whether the given number is
CO2 L3 5M
Fibonacci or not.
7 a) Develop a program to print the following pattern: CO2 L3 5M
a) Develop a program to print the following pattern:
1
12
CO2 L3 5M
123
1234
12345
a) Develop a C program to find whether the given number is
a palindrome number or not.
Note: A palindrome number is a number that remains the
CO2 L3 5M
same when digits are reversed.
8
For example, the number 12321 is a palindrome number, but
1451 is not a palindrome number.
b) Develop a program to check whether the given number is
CO2 L3 5M
prime or not.
a) Construct a program to check whether the given number
is strong number or not.
Note: A number can be said as a strong number when the CO2 L3 5M
sum of the factorial of the individual digits is equal to the
number. For example, 145 is a strong number.
9 b) Develop a C program to check whether number is Perfect
Square or not.
Note: A perfect square is a number that can be expressed as
CO2 L3 5M
the product of an integer by itself or as the second exponent
of an integer. For example, 25 is a perfect square because it
is the product of integer 5 by itself, 5 × 5 = 25.
a) Construct a C Program to determine whether a given year
is a Leap year or not.
CO2 L3 5M
Example: Test Case 1: Enter a year: 1900 1900 is not a leap
year. Test Case 2: Enter a year: 2012 2012 is a leap year.
b) You and your three friends have decided to go for a trip
by sharing the expenses of the fuel equally. Write a C
10 program to calculate the amount (in Rs) each of them need
to put in for the complete (both to and from) journey when
mileage, amount per litre of fuel and distance for one way is CO2 L3 5M
given.
Sample input: Mileage of the vehicle (Km/litre): 12 Amount
per litre: 65 Distance travelled one way: 96 Expected
output: amount (in Rs) each of them need to put: 260
UNIT III

Short Answer Questions (2 Marks Each)

Q.
QUESTION CO LEVEL MARKS
NO.
Describe array declaration and initialization with an CO1 L2 2M
1
example.
2 Illustrate two dimensional arrays with a suitable example. CO1 L2 2M
Illustrate a C program to read the elements of 1-D array and CO1 L2 2M
3
print them.
4 Summarise arrays and its types. CO1 L2 2M
Illustrate a program in C to find the sum of all elements of CO1 L2 2M
5
the array.
Describe string declaration and initialization with an CO1 L2 2M
6
example.
Explain the following string handling functions: i) strcmp() CO1 L2 2M
7
ii) strncmp()
Explain the following string handling functions: i) strcpy() CO1 L2 2M
8
ii) strrev()
9 Illustrate two dimensional character array with an example. CO1 L2 2M
Explain briefly the following string manipulation functions: CO1 L2 2M
10
i. strlen() ii. strncat()

Long Answer Questions (10 Marks Each)


(Can have Sub Questions also)

Q.
QUESTION CO LEVEL MARKS
NO.
a) Classify various types of arrays in C language with
CO3 L3 5M
respect to dimensions.
1
b) Explain with an example the following string handling
functions: CO1 L2 5M
i) sttrlen() ii) strcmp() iii) strstr()
a) Develop a program in C to copy the elements of one
CO3 L3 5M
array into another array.
2
b) Build a program in C to find the length of a string
CO3 L3 5M
without using library function.
a) Explain declaration and initialization of an array with an
CO1 L2 5M
example.
3
b) Develop a program to check whether given string is
CO3 L3 5M
palindrome or not
Develop a program to sort the strings in lexicographical
4 CO3 L3 10M
order.
5 Develop a C program to perform matrix multiplication. CO3 L3 10M
a) Develop a program to remove duplicate elements from an
CO3 L3 5M
array.
6
b) Develop a program to print the sum of the elements of a
CO3 L3 5M
given array.
a) Develop a C program to read the elements of 1-D array
CO3 L3 5M
using and print them in reverse order.
7
b) Construct a C program to find 2nd largest element in an
CO3 L3 5M
array.
a) Develop a C Program to find 2nd smallest element in an
CO3 L3 5M
array.
8
b) Make use of any five string manipulation functions
CO3 L3 5M
along with syntax and an example for each type?
a) Explain how 1-d arrays are declared and initialized in C. CO2 L2 5M
9 b) List the different types of string manipulation functions
CO2 L2 5M
in C and write their usage with simple examples.
a) Develop a C program to perform the operation of
CO3 L3 5M
addition of two matrices.
10
b) Develop a C program to find the length of a given string
CO3 L3 5M
without using built-in functions.

UNIT IV

Short Answer Questions (2 Marks Each)

Q.
QUESTION CO LEVEL MARKS
NO.
1 Contrast dereferencing and address operators in C. CO1 L2 2M
2 List various user defined data types in C. CO1 L2 2M
3 Describe pointer with an example. CO1 L2 2M
4 List the differences between array and pointer. CO1 L2 2M
5 Describe about macro? CO1 L1 2M
6 Explain structure with an example. CO1 L2 2M
7 Explain bit-fields with suitable example. CO1 L2 2M
8 Compare structure with union. CO1 L2 2M
9 List dynamic memory allocation memory functions in C. CO1 L2 2M
10 Explain pointer arithmetic in C. CO1 L2 2M

Long Answer Questions (10 Marks Each)


(Can have Sub Questions also)

Q.
QUESTION CO LEVEL MARKS
NO.
a) Develop a C program using the following library
CO3 L3 5M
functions: i) malloc() ii) realloc() iii) free()
1
b) Compare and contrast various user-defined data types in
CO4 L4 5M
C language.
a) Build a C program to illustrate the usage of pointer to a
CO3 L3 5M
pointer.
2
b) Develop a C program to compare two arrays using
CO3 L3 5M
pointers.
a) Construct a C program to find the length of the string
CO3 L3 5M
using pointers.
3
b) Develop a program in C to store ‘n’ integer elements in
CO3 L3 5M
an array and print the elements using pointer.
Illustrate dynamic memory management functions with
4 CO1 L2 10M
examples.
a) Identify all the differences between dynamic memory CO3 L3 5M
allocation functions malloc() and calloc() using suitable
5
examples.
b) Develop a C program to illustrate pointer arithmetic. CO3 L3 5M
a) Develop C program to read the elements of 1-D array
using pointers and print them in reverse order using CO3 L3 5M
6
pointers.
b) Explain the differences between Structures and Unions. CO2 L2 5M
Develop a C Program to read and print the elements of 1-D
array using calloc() memory allocation function and
7 CO3 L3 10M
reallocate memory for the array by increasing the size of the
array, read and print the elements of reallocated(total) array.
Examine a C program to store name, roll number, year and
marks of three subjects of ‘n’ students and print the student
the name, roll number, average and grade based on average
marks of the student using structures.
8 CO4 L4 10M
if average is between 80-90 grade is O,
if average is between 60-79 grade is A,
if average is between 40-59 grade is B,
otherwise Fail.
a) Summarize the following with relevant examples:
CO3 L2 5M
i) Structure with in a structure ii) Array of structures
9 b) Mention the disadvantages of Recursion. Build a C
Program to generate Fibonacci series till ‘n’ terms using CO3 L3 5M
recursion.
Analyze a C program to read employee details employee
number, employee name, basic salary of n employees using
structures and print employee number, employee name and CO4
10 L4 10M
gross salary of n employees.
Gross salary = Basic + HRA + TA + DA
HRA = 15% of Basic Salary
TA = 10% of Basic Salary
DA = 5% of Basic Salary

UNIT V

Short Answer Questions (2 Marks Each)

Q.
QUESTION CO LEVEL MARKS
NO.
1 Explain different element of function with an example. CO1 L2 2M
2 Contrast call by value and call by reference. CO1 L2 2M
Describe the modification of parameters inside functions CO1 L2 2M
3
using pointers?
Explain the benefits and drawbacks of passing arrays as CO1 L2 2M
4
arguments to functions.
Summarize user defined Functions based on return types CO1 L2 2M
5
and arguments.
6 Describe about recursion? CO1 L2 2M
7 Illustrate storage classes available in C language. CO1 L2 2M
8 Explain about different types of files. CO1 L2 2M
9 Explain various file opening modes. CO1 L2 2M
10 Describe various operations can be performed on a file. CO1 L2 2M

Long Answer Questions (10 Marks Each)


(Can have Sub Questions also)

Q.
QUESTION CO LEVEL MARKS
NO.
a) Explain the different ways of passing parameters to the
CO1 L2 5M
function with examples.
1
b) Elaborate the usage of fprintf(), fputs(), fputc(), fwrite()
CO3 L3 5M
functions to write data to files along with a sample program.
a) Analyzing the recursive algorithm to find the factorial of
CO4 L4 5M
a given number.
2
b) Develop a program in C to append the contents of one
CO3 L3 5M
file to the end of another file.
a) Construct a C program to demonstrate the scope and
CO3 L3 5M
lifetime of variables.
3
b) Build a ‘C’ program that counts the number of characters
CO3 L3 5M
present in a file.
a) Develop a C program using the concept of functions to
swap the values of two variables without using third CO3 L3 5M
4
variable.
b) Explain various file operations with syntax. CO1 L2 5M
5 a) Compare and contrast recursion and iteration with CO4 L4 5M
suitable example.
b) Illustrate the following file handling functions with an
CO1 L2 5M
example: i) fopen() ii) fclose()
a) Define recursion. Making use of recursion to: i) Find the CO3
factorial of a given number ii) Generate the Fibonacci L3 5M
6 numbers up to N.
b) Build a ‘C’ program that counts the number of characters CO3
L3 5M
present in a file.
a). CO3 L3 5M
b) Develop a C program to reverse a given integer number CO3
7 using recursive functions.
L3 5M
Example: If the number 456 is given, 654 should be
displayed as output.
a). CO3 L3 5M
8 b) Develop a program to demonstrate passing an array as
CO3 L3 5M
an argument to a function.
a) Explain different ways of passing parameters to the
CO1 L2 5M
function.
9
b) Build a program to add the contents of one file at the end
CO3 L3 5M
of another.
a) Write a C program using the concept of functions to
CO3 L3 5M
10 swap the values of variables without using third variable.
b) Compare and contrast various text file opening modes. CO4 L4 5M

Course Coordinator HOD

You might also like