Structured Programming Lab
CIS · Quiz · Spring 26
Paper 2 of 2Section A · Batch 24 · Md Shahinur Rahman (স জি ব) (2)Switch
Section A · Batch 24
Paper 2 of 2
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Makeup Quiz (Set A) - Spring 2026 - Course: Structured Programming
Also set B
Student Name: ID:
Instructions: Answer all questions. Write your C code clearly in the provided spaces. Syntax accuracy and logical correctness will be evaluated. Duration: 25 Minutes.
Q1. Write a complete C program that declares an integer array of size N (where N is provided by the user). The program must take the N elements as input from the user, search through the array, and print the maximum value stored within it. [7 Marks]
Q2. Write a C program that includes a user-defined function named sumOfEvenDigits. This function must take a positive integer as an argument, isolate its digits, calculate the sum of only the even digits, and return the result. Include the main() function to demonstrate taking user input, calling this function, and printing the returned sum. [8 Marks]
Q1. The median of three distinct numbers is the value that falls in the middle when they are sorted in order (e.g., if the inputs are 12, 5, and 18, the median is 12). Write a complete C program that takes three distinct integers as input from the user and determines the median value. [7 Marks]
Q2. Write a complete C program utilizing a nested loop structure to generate the following exact star pattern. Assume the number of rows is entered by the user (the example below assumes N = 5). [8]
[Figure: A right-angled triangle of stars aligned to the left, starting with 5 stars on the first row and decreasing by 1 star per row down to 1 star]