Harvard CS50 Week 1: Data Types & Variables Questions And Answers.
Harvard CS50 Week 1: Data Types & Variables Questions And Answers. What is an "int?" - CORRECT ANSWER -The int data type is used for variables that will store integers - Integers always take up 4 bytes of memory(32 bits). Range of information that can be stored is limited to 32 bits What is an "unsigned int?" - CORRECT ANSWER - qualifier that effectively doubles the range of positive variables of that type at the expense of negative values What is a "char?" - CORRECT ANSWER - used for variables that will store single characters - chars only take 1 byte of memory(8 bits) What is a "float?" - CORRECT ANSWER - used for variables that will store floating point values, or real numbers(numbers w/ decimal point) - always take up 4 bytes of memory(32 bits) - they have a precision problem What is a "double?" - CORRECT ANSWER - also stores floating point values - they are double precision, therefore more precise with real numbers - take up 8 bytes of memory(64 bits)
Written for
- Institution
- Harvard University
- Course
- CS50
Document information
- Uploaded on
- May 26, 2024
- Number of pages
- 2
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs50
-
harvard cs50 week 1 data types variables questi
Also available in package deal