Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q) What the output?
int number = 6;
int sum = 0; for (int i = 1; i < number; ++i) { if (number % i == 0) { sum += i; }} if (sum == number) cout << number << " is perfect." << endl; else cout << number << " is not perfect." << endl;
int number = 6;
int sum = 0; for (int i = 1; i < number; ++i) { if (number % i == 0) { sum += i; }} if (sum == number) cout << number << " is perfect." << endl; else cout << number << " is not perfect." << endl;
Anonymous Quiz
67%
A) 6 is a perfect.
17%
B) 6 is not a perfect.
13%
C) Error
4%
D) 0
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What does the following code print?
int num = 9; int i = 1; while (i <= 10) { cout << num << " x " << i << " = " << num * i << endl; i++; }
Q) What does the following code print?
int num = 9; int i = 1; while (i <= 10) { cout << num << " x " << i << " = " << num * i << endl; i++; }
Anonymous Quiz
12%
A) Multiplication table of 5 up to 10
72%
B) Multiplication table of 9 up to 10
8%
C) Multiplication table of 10 up to 9
8%
D) Nothing
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q) What does the following code print?
int n = 5;
int factorial = 1; int i = 1; while (i <n) { factorial *= i; i++; } cout << "Factorial of " << n << " is " << factorial << endl;
int n = 5;
int factorial = 1; int i = 1; while (i <n) { factorial *= i; i++; } cout << "Factorial of " << n << " is " << factorial << endl;
Anonymous Quiz
19%
A) Factorial of 5 is 5
50%
B) Factorial of 5 is 120
8%
C) Factorial of 5 is 60
23%
D) Factorial of 5 is 24
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What does the last code (in image) print?
Q) What does the last code (in image) print?
Anonymous Quiz
65%
A) 12321 is a palindrome.
17%
B) 12321 is not a palindrome.
17%
C) Error
0%
D) 321
🎲 اختبار 'إختبار أساسيات برمجة بإستخدام سي بلس بلس 2️⃣'
إختبار أساسيات برمجة بإستخدام سي بلس بلس. Eng. Hazem F. Al-Huthaifi قناة علوم البيانات : @Computer_DS_1 التعليم لمن اراد والشهادة للجميع
🖊 12 سؤالًا · ⏱ 45 ث
إختبار أساسيات برمجة بإستخدام سي بلس بلس. Eng. Hazem F. Al-Huthaifi قناة علوم البيانات : @Computer_DS_1 التعليم لمن اراد والشهادة للجميع
🖊 12 سؤالًا · ⏱ 45 ث
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
true or false (√ or ×)
Q) High-level languages require programmers to concentrate on hardware details.
Q) High-level languages require programmers to concentrate on hardware details.
Anonymous Quiz
65%
True (√)
35%
False (×)
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
true or false (√ or ×)
Q) A computer program consists of a set of ordered instructions.
Q) A computer program consists of a set of ordered instructions.
Anonymous Quiz
87%
True (√)
13%
False (×)
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
true or false (√ or ×)
Q) The output statement in C++ uses is cout.
Q) The output statement in C++ uses is cout.
Anonymous Quiz
88%
True (√)
12%
False (×)
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
true or false (√ or ×)
Q) The main() function is the starting point of a C++ program.
Q) The main() function is the starting point of a C++ program.
Anonymous Quiz
88%
True (√)
12%
False (×)
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
true or false (√ or ×)
Q) An interpreter translates and executes each line of the source program.
Q) An interpreter translates and executes each line of the source program.
Anonymous Quiz
65%
True (√)
35%
False (×)
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What does the goto statement do?
Q) What does the goto statement do?
Anonymous Quiz
26%
A) Moves to the next iteration of a loop
65%
B) Transfers control to another part of the program
3%
C) Ends the program
6%
D) Skips over a specific line of code
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) In a for loop, which of the following is executed only once at the beginning?
Q) In a for loop, which of the following is executed only once at the beginning?
Anonymous Quiz
54%
A) Initialization
22%
B) Condition check
19%
C) Increment/Decrement
5%
D) Loop body
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
true or false (√ or ×)
Q) Which type of loop checks the condition before executing the loop body?
Q) Which type of loop checks the condition before executing the loop body?
Anonymous Quiz
26%
A) for-loop
31%
B) while-loop
13%
C) do-while loop
31%
D) All of the above
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q)In C++, what is the correct syntax to declare a switch statement?
Q)In C++, what is the correct syntax to declare a switch statement?
Anonymous Quiz
72%
A) switch(variable) { case value: ... }
8%
B) switch { variable: ... }
13%
C) switch() { case value; ... }
8%
D) switch: { variable case value }
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What is the size of a Boolean variable in C++?
Q) What is the size of a Boolean variable in C++?
Anonymous Quiz
40%
A) 1 bit
45%
B) 1 byte
8%
C) 4 bytes
8%
D) 2 bytes
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What will be the output of the following?
int x = 3, y = 5; cout << x + y << endl;
Q) What will be the output of the following?
int x = 3, y = 5; cout << x + y << endl;
Anonymous Quiz
11%
A) 35
89%
B) 8
0%
C) 53
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What will be the output of the following?
int a = 2, b = 3, result = 1, power = b; while (power != 0) { result *= a; power--; } cout << a << " raised to the power of " << b << " is: " << result << endl;
Q) What will be the output of the following?
int a = 2, b = 3, result = 1, power = b; while (power != 0) { result *= a; power--; } cout << a << " raised to the power of " << b << " is: " << result << endl;
Anonymous Quiz
11%
A) 2 raised to the power of 3 is: 6
61%
B) 2 raised to the power of 3 is: 8
11%
C) 2 raised to the power of 3 is: 9
17%
D) Error
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What will be the output of the following?
int n = 5; int sum = 0; for (int i = 1; i <= n; i++) { sum += i * i; } cout << "Sum of squares from 1 to " << n << " is: " << sum << endl;
Q) What will be the output of the following?
int n = 5; int sum = 0; for (int i = 1; i <= n; i++) { sum += i * i; } cout << "Sum of squares from 1 to " << n << " is: " << sum << endl;
Anonymous Quiz
33%
A) Sum of squares from 1 to 5 is: 25
22%
B) Sum of squares from 1 to 5 is: 30
39%
C) Sum of squares from 1 to 5 is: 55
6%
D) Sum of squares from 1 to 5 is: 15
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What will be the output of the following?
int n = 10, a = 0, b = 1, nextTerm; for (int i = 1; i <= n; ++i) { cout << a << " "; nextTerm = a + b; a = b; b = nextTerm; }
Q) What will be the output of the following?
int n = 10, a = 0, b = 1, nextTerm; for (int i = 1; i <= n; ++i) { cout << a << " "; nextTerm = a + b; a = b; b = nextTerm; }
Anonymous Quiz
62%
A) 0 1 1 2 3 5 8 13 21 34
18%
B) 1 1 2 3 5 8 13 21 34
10%
C) 1 2 3 5 8 13 21 34 55
10%
D) 1 2 4 8 16 32
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
select the best choice among all :
Q) What will be the output of the following?
int n = 10, sum = 0; for (int i = 1; i <= n; i++) { if (i % 2 == 0) sum += i; } cout << "Sum of even numbers between 1 and " << n << " is: " << sum << endl;
Q) What will be the output of the following?
int n = 10, sum = 0; for (int i = 1; i <= n; i++) { if (i % 2 == 0) sum += i; } cout << "Sum of even numbers between 1 and " << n << " is: " << sum << endl;
Anonymous Quiz
37%
A) Sum of even numbers between 1 and 10 is: 20
43%
B) Sum of even numbers between 1 and 10 is: 30
11%
C) Sum of even numbers between 1 and 10 is: 25
9%
D) Sum of even numbers between 1 and 10 is: 15