Cpps Question Bank Sem
Cpps Question Bank Sem
UNIT-1
BL: Apply – 23 Q
CO1: Solve various problems using sequential and conditional problem solving approaches
Q.5 Define what a conditional approach is. Provide an example 5M Understand CO1
where a decision is required.
Q.6 Define pseudocode. Write a pseudocode to find the sum and 5M Understand CO1
average of given three numbers.
Q.8 Draw and briefly explain five symbols commonly used in a 5M Understand CO1
flowchart.
Q.13 Draw a flowchart to find the sum of the first 100 natural 5M Apply CO1
numbers.
Q.14 Draw a flowchart for the process of placing an online order. 6M Apply CO1
Q.15 Draw a flowchart to check if a given number is prime or not. 5M Apply CO1
Q.16 Write an algorithm to exchange values of two variables with 5M Apply CO1
a temporary variable
Q.17 Flowchart for printing odd numbers less than a given number. 7M Apply CO1
It should also calculate their sum and count.
Q.18 Create a simple pseudocode that takes a positive integer as 7M Apply CO1
input and counts the number of digits in that integer.
Q.19 Design an algorithm for a car wash service process. 7M Apply CO1
Q.20 Design a flowchart that models the process of borrowing a 7M Apply CO1
book from a library. Include steps like checking book
availability, verifying user membership, issuing the book, and
setting the return due date.
Q.21 Write pseudo code that will count all the even numbers up to 6M Apply CO1
a user defined stopping point.
Q.22 Construct an algorithm for the college student admission 6M Apply CO1
process.
Q.23 Write pseudo code to print all multiples of 5 between 1 and 6M Apply CO1
100 (including both 1 and 100).
Q.24 Draw a flowchart for calculating the average from 25 exam 7M Apply CO1
scores.
Q.25 Design an algorithm which generates even numbers between 5M Apply CO1
1000 and 2000 and then prints them in the standard output. It
should also print total sum
Q.26 Create a simple pseudocode that takes three numbers as input 5M Apply CO1
and outputs the largest number among them.
Q.27 Write an iterative algorithm to find the maximum number in a 6M Apply CO1
list of integers.
Q.28 Design a flowchart that models the process of registering for 7M Apply CO1
an online exam. Include decision points for checking
available exam slots, verifying payment, and confirming the
registration.
Q.29 Develop an algorithm that determines the eligibility to vote 6M Apply CO1
based on age and citizenship.
Q.30 Write pseudo code that performs the following: Ask a user to 6M Apply CO1
enter a number. If the number is between 0 and 10, write the
word blue. If the number is between 10 and 20, write the
word red. if the number is between 20 and 30, write the word
green. If it is any other number, write that it is not a correct
color option.
Q.33 The flow chart on the right is meant to show the steps 5M Analyze CO1
SET N = 10
FOR i FROM 1 TO N DO
total = total + i
END FOR
PRINT total
What does this pseudocode do, and what will be the output if
N is set to 10?
PRINT "Even"
ELSE
PRINT "Odd"
END IF
SET count = 1
count = count + 1
END WHILE
IF (x = 10) THEN
END IF
y = x += 3
Q.39 Design a detailed flowchart for an online shopping process 5M Apply CO1
that allows customers to browse products, add items to their
shopping cart, proceed to checkout, make payments, and
complete their online purchase. The process should include
steps for both registered and guest users.
SET count = 0
Q.40 FOR i = 1 TO 10 5M Analyze CO1
IF i MOD 3 = 0 THEN
count = count + 1
ELSE IF i MOD 4 = 0 THEN
count = count + 2
END IF
END FOR
PRINT count
Q.4 Design a program that calculates the factorial of a number and 5M Apply CO2
handles invalid inputs.
Q.7 Investigate the performance of different algorithms for power 5M Analyze CO2
computation (e.g., naive vs. exponentiation by squaring).
Q.8 Develop a function that computes powers efficiently and includes 5M Apply CO2
error handling for edge cases
Q.9 Discuss the space and time complexity of the Fibonacci generation 5M Understand CO2
algorithms.
Q.10 Write a program that generates Fibonacci numbers up to a 5M Apply CO2
specified limit and outputs them in a formatted way.
Q.11 Define what it means to reverse the digits of a number. 5M Understand CO2
Q.12 Describe the steps involved in reversing a number's digits. 5M Understand CO2
Q.13 Reverse the digits of the number 12345 using a programming 5M Apply CO2
language.
Q.14 Explore different algorithms for reversing digits and their 5M Analyze CO2
efficiencies.
Q.15 Build a user-friendly application that allows users to input a 5M Apply CO2
number and see its digits reversed.
Q.17 Explain the relationship between squares and square roots. 5M Understand CO2
Q.18 Design an algorithm to establish all the primes in the first n 5M Apply CO2
positive integers.
SET a = 1664525
SET c = 1013904223
SET m = 2^32
FOR i = 1 TO 10
END FOR
What will be the first four outputs generated based on the given
seed and constants?
Q.20 Describe how to find the smallest divisor of a given integer. 5M Understand CO2
Q.21 Discuss how prime factorization can assist in finding the smallest 5M Evaluate CO2
divisor.
Q.22 Implement a program that finds and displays the smallest divisor 5M Create CO2
of any input integer.
Q.23 Give a stepwise explanation for reversing the digits of a given 5M Understand CO2
number.
Q.24 Write an algorithm to find the GCD of 48 and 18. 5M Apply CO2
Q.26 Explain the relationship between GCD and LCM. 5M Understand CO2
Q.27 Analyze how the LCM can be computed using the GCD. 5M Analyze CO2
SET i = 2
Q.28 WHILE i * i <= n DO 5M Analyze CO2
IF n MOD i = 0 THEN
PRINT i
SET n = n / i
ELSE
SET i = i + 1
END IF
END WHILE
IF n > 1 THEN
PRINT n
END IF
Q.29 Define prime numbers and list the first ten. 5M Remember CO2
Q.30 Explain the characteristics that define a prime number. 5M Understand CO2
Q.31 Write a C program to generate and display prime numbers within a 5M Apply CO2
user-defined range.
SET a = 178
SET c = 11032
SET m = 2^16
FOR i = 1 TO 5
PRINT seed
END FOR
What will be the first four outputs generated based on the given
seed and constants?
Q.33 Define prime factors. 5M Remember CO2
SET a = 210
SET c = 12345
SET m = 2^31
FOR i = 1 TO 5
PRINT seed
END FOR
What will be the first four outputs generated based on the given
seed and constants?
Q.36 Write a program that computes the LCM of a list of numbers. 5M Apply CO2
Q.37 Describe different methods to compute the n-th Fibonacci number. 5M Understand CO2
Q.38 What will be the output of the given pseudo code? 5M Analyze CO2
Integer a, b, c
a=5
b=6
while(a > 0)
c=a+b
b- -
a- -
Print c
End while
FOR i = 1 TO n DO
IF i MOD 2 = 0 THEN
END IF
END FOR
PRINT sum
Q.40 Generate a list of pseudo-random numbers using a standard library 5M Apply CO2
function.
FOR i = 1 TO sqrt(n) DO
Q.41 IF n MOD i = 0 THEN 5M Analyze CO2
PRINT i
IF i ≠ n / i THEN
PRINT n / i
END IF
END IF
END FOR
BL: Apply – 23 Q
14 How to store 2D arrays of size 3x3 and print the 2 Understand CO3
matrix.
15 What will be the output of the program if the array 3 Analyze CO3
begins 1200 in memory?
#include<stdio.h>
int main()
{
int arr[]={2, 3, 4, 1, 6};
printf("%u, %u, %u\n", arr, &arr[0], &arr);
return 0;
}
16 How to find the first repeating element in an array of 3 Understand CO3
integers
23 4 Apply CO3
Write an algorithm to make a histogram of an array
25 6 Apply CO3
C Program to convert Decimal to Binary
27 6 Apply CO3
Write a program in C to find the number of times a
given number appears in an array.
28 3 Understand CO3
Declare and initialize a multidimensional array.
29 2 Understand CO3
Define multi-dimensional array and draw it’s memory
representation
30 3 Apply CO3
Write an algorithm to find Summation of a set of
numbers
31 5 Understand CO3
Explain Union of two sets with example.
Discuss key differences between linear search and
32 binary search. 5 Understand CO3
34 5 Understand CO3
Explain the concept of union of two ordered sets to
get a new ordered set with the help of suitable
examples. Take the size of each set at least 6.
35 5 Apply CO3
Write a program to store rainfall in the month of
August and determine the highest rainfall in that
month.
36 5 Analyze CO3
Determine the output of the following code:
#include <stdio.h>
int main() {
int A[] = {1, 1, 0 ,0 ,1, 1};
if(A[i] == 1){
if(B[i] == 1)
C[i] = 1;
else
C[i] = 0;
else
C[i] = 0;
return 0;
}
37 5 Apply CO3
Design an algorithm to establish all the primes in the
first n positive integers.
Write a step-by-step explanation for removing
38 duplicate elements and producing a resultant array 5 Understand CO3
with unique values for an array of integers.
Describe the process of converting the binary
39 number 377 to binary. Perform the conversion and 5 Apply CO3
write the final result.
Describe the process of converting the binary
40 number 1000001 to octal. Perform the conversion 5 Apply CO3
and write the final result.
UNIT-4
CO4: Apply the searching and sorting techniques for problem solving.
19 Use Linear Search to find the position of the number 5 Apply CO4
75 in the array: [12, 34, 56, 75, 89, 10, 23, 45]. Walk
through the steps taken during the search.
435190
22 Use Binary Search to find the position of the number 5 Apply CO4
44 in the sorted array: [2, 6, 13, 17, 29, 44, 58, 61].
Show the midpoint calculations and steps involved.
23 What is insertion sort? How many passes are required 5 Understand CO4
for the elements to be sorted ?
28 Explain how Bubble Sort works to sort an array and 4 Understand CO4
how the largest elements "bubble up" to the end of
the list.
34 Use Selection Sort to find the smallest and second 5 Apply CO4
smallest elements in the following array: [34, 22, 10,
19, 17].
35 Write a C program to implement Bubble Sort. Sort 5 Apply CO4
the following array: [64, 34, 25, 12, 22, 11, 90] and
display the sorted array.
BL: Apply – 07 Q
Q.1 Explain the concept of a stack and its key 5M Understand CO5
characteristics
Q.4 What is stack? Explain any two applications of stack 5M Understand CO5
with examples.
Q.5 Give the disadvantage of ordinary queue and how it is 4M Understand CO5
solved in circular queue.
Q.6 What is a circular queue? Explain how it differs from 4M Understand CO5
linear queue.
Q.7 Write an algorithm for push operations of stack with 5M Apply CO5
example.
Q.8 Write a pseudocode for below queue operations with 5M Understand CO5
necessary declarations.
Q.9 Show how queues are represented using arrays 5M Understand CO5
Q.10 What are the various Operations performed on the 5M Understand CO5
Stack?
Q.13 Write an algorithm for Push and Pop operations on 5M Apply CO5
Stack
Q.17 Write function definitions for isFull() and Enqueue() 5M Analyze CO5
functions of Queue, using given prototypes and
declarations for array implementation:
#define size
int Queue[size], front, rear;
int isFull();
ii.
iii.
iv.
v.
Q.19 Define priority queue with diagram and give the 5M Understand CO5
operations
Q.21 What's the output of this code? Assume all stack 5M Analyze CO5
functions definitions are available.
#include <stdio.h>
int stack[12];
int main() {
int i;
if(i % 2 == 0)
push( i + 1);
if(i % 3 == 0)
push( i - 1);
while(!isempty())
printf("%d\n", pop());
return 0;
Q.22 Write the status of stack after each operation: 5M Analyze CO5
Push 70
Push 100
Pop
Pop
Push 12
Peek
Pop
Push 5
Q.23 Write down the status of Queue after each of the 5M Analyze CO5
successive operation:
enqueue (70)
dequeue( )
enqueue(80)
enqueue(90)
dequeue( )
dequeue( )
Q.24 Write similarities and differences between Stack and 5M Understand CO5
Queue in a tabular form. Give one real life situation
where each of them can be used.
Q.25 Find output of the given code. Assume all queue 5M Analyze CO5
functions are defined in the code. Show all steps and
explain in brief.
#include <stdio.h>
int queue[10];
int main() {
int i;
for(i = 0; i < 4; i++) {
if(i % 2 == 0)
enqueue( i + 1);
if(i % 3 == 0)
enqueue( i);
while(!is_empty())
printf("%d\n", dequeue());
return 0;
Q.28 What's the output of this code? Assume all stack 5M Analyze CO5
functions definitions are available.
#include <stdio.h>
int stack[12];
int main() {
int i;
for(i = 0; i < 10; i++){
if(i % 2 == 0)
push( i + 1);
if(i % 3 == 0)
push( i - 1);
while(!isempty())
printf("%d\n", pop());
return 0;
ii.
iii.
iv.
PUSH(10)
Q.30 PUSH(20) 5M Analyze CO5
POP()
PUSH(30)
PUSH(40)
POP()
PUSH(50)
PRINT STACK
int stack[MAX_SIZE];
int top = -1;
int main() {
for (int i = 0; i < MAX_SIZE; i++) {
stack[++top] = i * 2; // Push elements 0, 2, 4, 6,
8
}
return 0;
}
Q.34 What is queue? Explain any two applications of queue 5M Understand CO5
with examples.
#include <stdio.h>
Q.35 #define MAX_SIZE 5 5M Analyze CO5
int stack[MAX_SIZE];
int top = -1;
int main() {
for (int i = 0; i < MAX_SIZE; i++) {
stack[++top] = i * 2;
}
return 0;
}
#include <stdio.h>
Q.38 #define MAX_SIZE 4 5M Analyze CO5
int stack[MAX_SIZE];
int top = -1;
int main() {
for (int i = 0; i < MAX_SIZE; i++) {
stack[++top] = i + 1; // Pushing values 1, 2, 3,
4
}
return 0;
}