Structured Programming
SWE · Quiz · Spring 26
Paper 4 of 6Section 46 O · Sakhawat Shahriar Porag (1)Switch
Section 46 O
Paper 4 of 6
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Daffodil International University
Department of Software Engineering
Faculty of Science and Information Technology
Quiz 1, Spring 2026; Course Code: SE 121;
Course Title: Structured Programming; Section: 46 O
Time: 30 Minutes
Marks: 15
Answer ALL Questions
[The figures in the right margin indicate the full marks. All portions of each question must be answered sequentially.]
1. a) Rewrite the program in a correct and compilable form.
#include <stdio.h
int main{}(
int a = 5, b = 0;
float x = 3.5;
char ch = 'A';
if (a > 0 and b == 0) printf("Both conditions are true\n");
printf("Value of a = %f\n", a);
printf("Value of x = %d\n", x);
printf("Character = %d\n", ch);
if (a > 0 || b) printf("Logical OR condition satisfied\n");
return 0;)
[Marks - 5]
b) A C program contains the following declarations and initial assignments:
int a = 10, b = 4;
int c = 3;
Determine the value of each of the following expressions. Use the values initially assigned to the variables for each expression.
(i) (a *b +c) % c
(ii) (a == b) || (a > b)
[Marks - 5]
2. a) A mobile operator provides free bonus minutes based on a user's call usage.Given:
- Total call duration in minutes
- Bonus threshold (minutes) Write a C program that:
1. Calculates how many full bonus blocks are completed
2. Uses an if-else statement to check whether the user is eligible for a bonus
- If the remaining minutes are 0, display Bonus applied successfully
- Otherwise, display Bonus not applicable
Sample Input | Sample Output
Total call minutes: 120 | Bonus blocks completed: 4
Bonus threshold: 30 | Bonus applied successfully
Total call minutes: 95 | Bonus blocks completed: 3
Bonus threshold: 30 | Bonus not applicable
[Marks - 5]