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)
Geschreven voor
- Instelling
- Harvard University
- Vak
- CS50
Documentinformatie
- Geüpload op
- 26 mei 2024
- Aantal pagina's
- 2
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
cs50
-
harvard cs50 week 1 data types variables questi
Ook beschikbaar in voordeelbundel