Skip to content

Programming and Problem Solving

CSE · Quiz · Fall 26

Paper 6 of 6Batch 72Switch

Batch 72 · shared by Ahnaf Tajwar

Paper 6 of 6

This browser can’t show the PDF here

Open it in a new tab or download it instead.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Daffodil International University Faculty of Science & Information Technology Department of Computer Science and Engineering Quiz-02(72_K) Course Code: CSE113, Course Title: Programming and Problem solving Time: 30 minutes Marks: 15 1. Find the output of the program. 6 i) #include <stdio.h> int main() { int tracker = 10; int points = 0; do { if (tracker % 3 == 0) { points = points + tracker; printf("Checkpoint Alpha: %d\n", points); } else { points = points + 1; } tracker = tracker - 2; }while (tracker > 2); printf("Final Status -> Tracker: %d, Points: %d\n", tracker, points); return 0; } ii) #include <stdio.h> int main() { int code = 1; int modifier = 5; switch (code + (modifier / 2)) { case 1: printf("Result: Blue\n"); break; case 3: printf("Result: Green\n"); case 4: printf("Result: Yellow\n"); break; case 5: printf("Result: Red\n"); break; default: printf("Result: Purple\n"); } return 0; } 2. Find the error of the program a. #include <stdio.h> b. int main() c. { d. int counter = 5; e. int system_score = 100; f. do { g. switch (counter % 2) h. { i. case 1: j. system_score -= (counter * 3); k. printf("Mode Alpha - Score: %d\n", system_score); l. break; m. case 0; n. system_score += (counter * 2) o. printf("Mode Beta - Score: %d\n", system_score); p. break; q. default: r. printf("System stable.\n"); s. } t. if (system_score < 70) { u. system_score = 70; v. printf("Warning: Low score override applied.\n"); w. counter--; x. } while (counter > 0) y. printf("Final Telemetry Score: %d\n", system_score); z. return 0: aa. } 3. In the mystical land of Numeria, two wizard brothers, Wizard A and Wizard B, guard the checkpoints of a sacred mountain path. Travelers are only allowed to pass through the path if they can find the secret "Harmony Numbers" hidden between the two checkpoint boundaries. A number achieves harmony only if it is simultaneously blessed by the Spirits of 5 and the Spirits of 7 (meaning it must be perfectly divisible by both 5 and 7, or in other words, divisible by 35!). Let's write a program to help the wizards automatically find these magical numbers between any two checkpoints a traveler chooses! Input: 10 80 Output: 35 70 4. In the digital world of Neon-Tokyo, a dangerous virus has broken out in the mainframe. To protect the core database, the Chief Security Officer decides to construct a dynamic cryptographic firewall shield. The shield is made up of a grid of heavy data blocks represented by the hash symbol (#). To deploy the firewall correctly, the computer system must build a perfect square grid based on the safety level requested by the security team. The code generator writes the firewall row by row, placing one data block at a time from left to right. Input: 5 Output: ##### ##### ##### ##### #####