Deck 2: Introduction to C Programming
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/21
العب
ملء الشاشة (f)
Deck 2: Introduction to C Programming
1
Which of the following statements would display the phrase C++ is fun?
A) std::cout << "Thisis fun\rC++ ";
B) std::cout << '++ is fun';
C) std::cout << "\"C++ is fun\"";
D) std::cout << C++ is fun;
A) std::cout << "Thisis fun\rC++ ";
B) std::cout << '++ is fun';
C) std::cout << "\"C++ is fun\"";
D) std::cout << C++ is fun;
A
2
Which is the output of the following statements?
Std::cout << "Hello ";
Std::cout << "World";
A) Hello World
B) World Hello
C) Hello World
D) World Hello
Std::cout << "Hello ";
Std::cout << "World";
A) Hello World
B) World Hello
C) Hello World
D) World Hello
A
3
Which of the following is a compilation error?
A) Placing a space between the symbols in the <= operator.
B) Using a triple equals sign instead of a double equals sign in the condition of an if statement.
C) Omitting the left and right parentheses for the condition of an if statement.
D) All of the above.
A) Placing a space between the symbols in the <= operator.
B) Using a triple equals sign instead of a double equals sign in the condition of an if statement.
C) Omitting the left and right parentheses for the condition of an if statement.
D) All of the above.
D
4
Which of the following is the escape character?
A) *
B) \
C) \n
D) "
A) *
B) \
C) \n
D) "
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
5
Which of the following is not an arithmetic operator?
A) +
B) -
C) =
D) %
A) +
B) -
C) =
D) %
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
6
The std::endl stream manipulator________.
A) inputs a newline.
B) flosses the output buffer.
C) outputs a newline and flushes the output buffer.
D) terminates the program.
A) inputs a newline.
B) flosses the output buffer.
C) outputs a newline and flushes the output buffer.
D) terminates the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
7
What is the value of result after the following C++ statements execute?
Int a, b, c, d, result;
A = 4;
B = 12; c = 37;
D = 51;
Result = d % a * c + a % b + a;
A) 119
B) 51
C) 127
D) 59
Int a, b, c, d, result;
A = 4;
B = 12; c = 37;
D = 51;
Result = d % a * c + a % b + a;
A) 119
B) 51
C) 127
D) 59
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of the following statements does not overwrite a preexisting value stored in a memory location?
A) int a;
B) number = 12;
C) y = y + 2;
D) width = length;
A) int a;
B) number = 12;
C) y = y + 2;
D) width = length;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
9
The ________ object enables a program to read data from the user.
A) std::cout.
B) std::cin.
C) std::cread.
D) std::cget.
A) std::cout.
B) std::cin.
C) std::cread.
D) std::cget.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the following statements does not cause a syntax error to be reported by the C++ compiler?
A) Mismatched {}.
B) Missing */ in a comment.
C) Missing ; at the end of a statement.
D) Extra blank lines.
A) Mismatched {}.
B) Missing */ in a comment.
C) Missing ; at the end of a statement.
D) Extra blank lines.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following statements could potentially change the value of number2?
A) std::cin >> number2;
B) sum = number1 + number2;
C) number1 = number2;
D) std::cout << number2;
A) std::cin >> number2;
B) sum = number1 + number2;
C) number1 = number2;
D) std::cout << number2;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
12
The assignment operator ________ assigns the value of the expression on its right to the variable on its left.
A) <-
B) ->
C) =
D) #
A) <-
B) ->
C) =
D) #
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
13
Which of the following is not a valid C++ identifier?
A) my Value
B) _AAA1
C) width
D) m_x
A) my Value
B) _AAA1
C) width
D) m_x
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
14
End-of-line comments that should be ignored by the compiler are denoted using:
A) Two forward slashes // ).
B) Three forward slashes /// ).
C) A slash and a star /* ).
D) A slash and two stars /** ).
A) Two forward slashes // ).
B) Three forward slashes /// ).
C) A slash and a star /* ).
D) A slash and two stars /** ).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
15
What will be the output after the following C++ statements have been executed?
Int a, b, c, d;
A = 4;
B = 12;
C = 37;
D = 51;
If a < b )
Cout << "a < b" << endl;
If a > b )
Cout << "a > b" << endl;
If d <= c )
Cout << "d <= c" << endl;
If c != d )
Cout << "c != d" << endl;
A) a < b c != d
B) a < b d <= c
C != d
C) a > b c != d
D) a < b c < d
A != b
Int a, b, c, d;
A = 4;
B = 12;
C = 37;
D = 51;
If a < b )
Cout << "a < b" << endl;
If a > b )
Cout << "a > b" << endl;
If d <= c )
Cout << "d <= c" << endl;
If c != d )
Cout << "c != d" << endl;
A) a < b c != d
B) a < b d <= c
C != d
C) a > b c != d
D) a < b c < d
A != b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
16
The escape sequence for a newline is:
A) \n
B) \t
C) \r
D) \a
A) \n
B) \t
C) \r
D) \a
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which of the following code segments prints a single line containing hello there with the words separated by a single space?
A) std::cout << "hello "; std::cout << " there";
B) std::cout << "hello" , " there";
C) std::cout << "hello"; std::cout << "there";
D) std::cout << "hello"; std::cout << " there";
A) std::cout << "hello "; std::cout << " there";
B) std::cout << "hello" , " there";
C) std::cout << "hello"; std::cout << "there";
D) std::cout << "hello"; std::cout << " there";
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
18
Which of the following is not a syntax error?
A) std::cout << 'Hello world! ';
B) std::cout << "Hello world! ";
C) std::cout << "Hello world! ";
D) std::cout << Hello world!;
A) std::cout << 'Hello world! ';
B) std::cout << "Hello world! ";
C) std::cout << "Hello world! ";
D) std::cout << Hello world!;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
19
In what order would the following operators be evaluated
-, *, /, +, %
Assume that if two operations have the same precedence, the one listed first will be evaluated first.
A) +, -, /, *, %
B) -, +, %, *, /
C) -, *, %, +, /
D) *, /, %, -, +
-, *, /, +, %
Assume that if two operations have the same precedence, the one listed first will be evaluated first.
A) +, -, /, *, %
B) -, +, %, *, /
C) -, *, %, +, /
D) *, /, %, -, +
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is a variable declaration statement?
A) int total;
B) #include
C) int main)
D) // first string entered by user
A) int total;
B) #include
C) int main)
D) // first string entered by user
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck
21
Each of the following is a relational or equality operator except:
A) <=
B) =!
C) ==
D) >
A) <=
B) =!
C) ==
D) >
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 21 في هذه المجموعة.
فتح الحزمة
k this deck