IP Week 2 C/C++ Overview
Quiz
•
Computers
•
University
•
Medium
Hai Minh Nguyen
Used 10+ times
FREE Resource
Enhance your content in a minute
34 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which variable(s) declaration is (are) incorrect?
int 4ever;
int hello-world;
int _Mystar;
int forever;
Answer explanation
The declaration 'int 4ever;' is incorrect because variable names cannot start with a digit. 'int hello-world;' is also incorrect due to the use of a hyphen, which is not allowed in variable names. The other declarations are valid.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the size of the 'bool' data type in C++?
2 bytes
4 bytes
1 byte
1 bit
Answer explanation
In C++, the 'bool' data type is typically 1 byte in size. This allows it to store two values: true and false. While it could theoretically be represented with just 1 bit, memory alignment and efficiency lead to it being allocated 1 byte.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the size of the 'char' data type in C++?
1 byte
4 bytes
2 bytes
8 bytes
Answer explanation
In C++, the 'char' data type is defined to be 1 byte in size. This is a standard size across most platforms, allowing it to represent a single character in memory.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Evaluate the following expression in C/C++:
true && false
true
false
Answer explanation
In C/C++, the expression 'true && false' uses the logical AND operator. Since one operand is false, the entire expression evaluates to false. Therefore, the correct answer is 'false'.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Evaluate the following expression in C/C++:
! ( 5 > 3 )
true
false
Answer explanation
The expression evaluates to !(true) since 5 > 3 is true. The logical NOT operator '!' negates true to false. Therefore, the correct answer is false.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following expression:
15 / 4
3.75
4
3
15
Answer explanation
The expression 15 / 4 equals 3.75. However, the correct answer choice provided is 3, which is the integer part of the division. Thus, the answer is 3.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following expression:
15 / 4.0
3.75
4
3
1
Answer explanation
The expression 15 / 4.0 divides 15 by 4.0, resulting in 3.75. Since 4.0 is a floating-point number, the division yields a decimal result, making 3.75 the correct answer.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
38 questions
TTL1 QUIZ
Quiz
•
University
30 questions
Hardware and Software Tutorial 2
Quiz
•
University
38 questions
ITE 292 NETWORKING 1 P2 EXAM
Quiz
•
University
29 questions
COMPTIA ITF
Quiz
•
1st Grade - Professio...
30 questions
Google Sheets Toolbar Quiz
Quiz
•
7th Grade - Professio...
32 questions
C++ Chapter 5 Review - Loops
Quiz
•
10th Grade - University
30 questions
Enterprise Resource Planning
Quiz
•
University - Professi...
32 questions
KIỂM TRA 45P- MS WORD
Quiz
•
University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
12 questions
Halloween
Quiz
•
3rd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
History of Halloween: Pagan or Christian?
Interactive video
•
11th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
