Civil Aviation Authority of Bangladesh
Post: Assistant Programmer
Exam Date: 2022, Exam Taker: CAAB
[Question Pattern: Bangla=15, English: 15; Math: 20; Technical: 30] Technical=30
#include
using namespace std;
int main() {
int n, sum = 0, m;
cout << "Enter a Number= "; cin >> n;
while (n > 0) {
m = n % 10;
sum = sum + m;
n = n / 10;
}
cout << "Summation of Every Digit = " << sum << endl;
return 0;
}
input: Enter a Number= 1234
output: Summation of Every Digit = 10
1+3+5+7+......+N


i. (4673)8=()16
ii. (7491)10=()16
Conversion of (4673)8 to Base 16
Base 8 to Decimal Calculation:
(4673)8 = (4 × 83) + (6 × 82) + (7 × 81) + (3 × 80)
= (2491)10
Decimal to Base 16 Calculation:
Divide the decimal number by 16 to get the digits from the remainders:
| Division | Quotient | Remainder | Digit |
|---|---|---|---|
| 2491 / 16 | 155 | 11 | B |
| 155 / 16 | 9 | 11 | B |
| 9 / 16 | 0 | 9 | 9 |
Thus, (4673)8 = (9BB)16.
Conversion of (7491)10 to Base 16
Decimal to Base 16 Calculation:
Divide the decimal number by 16 to get the digits from the remainders:
| Division | Quotient | Remainder | Digit |
|---|---|---|---|
| 7491 / 16 | 468 | 3 | 0 |
| 468 / 16 | 29 | 4 | 1 |
| 29 / 16 | 1 | 13 | D |
| 1 / 16 | 0 | 1 | 1 |
Thus, (7491)10 = (1D43)16.
5. Write Short Answer on the following (1*10=10)
A computer network is a system that connects two or more devices for transmitting and sharing information. These devices can communicate through physical wires or wirelessly.1
A constructor in C++ is a special method that is automatically called when an object of a class is created. The constructor has the same name as the class and is followed by parentheses ().
class MyClass {
public:
MyClass() { // Constructor
cout << "Hello World!";
}
};
int main() {
MyClass myObj; // Object creation (constructor is called)
return 0;
}
Software Development Life Cycle.
<a href="https://www.google.com/">Visit Google.com</a>;
DDL (Data Definition Language):
Used to define data structures like creating or altering tables in SQL.
Example:CREATE TABLE,ALTER TABLE.DML (Data Manipulation Language):
Used to manipulate data itself like inserting, updating, or deleting data.
Example:INSERT,UPDATE,DELETE.
A Trojan Horse or Trojan is malicious software disguised as legitimate software. It is designed to harm, steal, or disrupt data and networks.
Full-duplex communication allows simultaneous data transmission and reception between two devices. It is twice as fast as half-duplex communication.
Example: Communication over two separate wire pairs or channels like mobile call.
- X + X’Y
- = (X + X’) + X’Y
- = 1 + X’Y (Complement Law)
- = 1 (Final Answer)
while loop syntax:
while (testExpression) {
// body of the loop
}
do-while loop syntax:
do {
// body of the loop
} while (condition);
C++ has three access specifiers:
- Public: Members are accessible from outside the class.
- Private: Members are accessible only within the class.
- Protected: Members are not accessible outside the class but can be accessed in derived classes.
