Programming and Problem Solving
CSE · Quiz · Fall 26
Paper 8 of 9Section O · Batch 72Switch
Section O · Batch 72 · shared by Md. Arif Foysal Akif
Paper 8 of 9Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Name:
ID:
Daffodil International University
Dept. of Computer Science & Engineering
Course Title: Programming and Problem Solving
Time: 40 min, Course Code: CSE113, Quiz-2, Total Marks: 15
01: Identify output of the given code. [5]
#include <stdio.h>
int main()
{
int nums[] = {3, 6, 9, 12, 15};
int len = sizeof(nums) / sizeof(nums[0]);
int result = 0;
for (int i = 0; i < len; i++)
{
if (nums[i] % 2 == 0)
{
nums[i] /= 2;
}
else
{
nums[i] += nums[i - 1];
}
result += nums[i];
printf("%d\n", result);
}
return 0;
}
02: Suppose you have completed 4 quizzes in your Programming for Problem Solving (PPS) course. Write a C program to store these 4 quiz marks in an array, determine the minimum mark scored, and display the result. [5]
Sample Input | Sample Output
Enter Quiz Marks:
10 2 8 12 | Lowest is 2
03: A security team wants to measure the brute-force complexity of a PIN code that uses N distinct unique digits without repetition. The total number of unique sequences that can be formed using all N digits is the product of all positive integers from 1 up to N. Now, write a C program to input the number of digits N and compute the total possible unique sequences. Print the result. [5]
Sample Input | Sample Output
8 | 40320
5 | 120