Structured Programming
ITM · Midterm · Spring 26
Section A
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 Information Technology & Management
Mid-Term Examination, Spring 2026
Course Code: ITM121; Course Title: Structured Programming
Sections & Teachers: A, MA
Time: 1:30 Hrs
Marks: 25
Answer ALL Questions
[The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.]
1. a) Define variables and constants in your own words. Write down the syntax to declare and initialize a variable in C. | [Marks-3] | CO-1 Level-2
1. b) Explain the rules for naming variables in C. | [Marks-3]
1. c) Explain the 4 main parts of a loop. Differentiate between entry-controlled and exit-controlled loops. | [Marks-3]
1. d) Differentiate between int, float. | [Marks-1]
2. a) The ITM department system needs to check student usernames. Implement a C program using switch to determine whether an input character is a vowel or a consonant. | [Marks-4] | CO-2 Level-3
2. b) The ITM department system to validate username characters. Implement a C program to check whether an input character is a capital letter, small letter, digit, or special symbol and display the result. | [Marks-4]
2. c) 1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Implement a C program to print the above pattern. | [Marks-4]
2. d) The ITM department records student attendance for a lab session. The system scans student IDs one by one. If a student ID 0 is entered, it indicates that all remaining students are absent, and the scanning should stop immediately. Implement a C program that:
1. Continuously takes student IDs as input.
2. Prints each ID as present.
3. Stops scanning when the ID 0 is entered using a break statement. | [Marks-3]