CS50 Flashcards
what is the input to any computer?
elictiricity
what does electricity represent in computers?
zeros and ones
what is the highest you can count with 3 light bulbes?
up to 7 as we count from 0 and we have 8 patterns to count
how did we count that 123 is one hundred and twenty 3?
because from the right to the left we use the base of 10 3 * 1 + 10^0 2 * 10 + 10^1 1 * 100 + = 10^2 123
what is the base to calculate in binary systems?
2 ^ 0 1
2 ^1 2
2^ 2 4
how to represent letters in binary?
we use numbers to represent each letter
what is a byte?
8 bits
what is a bit?
a zero or a one
how many letters can u represent with a byte?
256
what is an algorithm?
it’s a step by step instruction to solve a problem
what is a compiler?
a software that converts source code to machine code?
what is machine code?
it’s the language of zeros and ones
how is the code evaluated?
from right to left
how many bytes in an int?
4 bytes (32 bits)
what is an unsigned integer?
it’s not a new data type it’s just a qualifier for int meaning it changes it’s properties containing only positive values
how many bytes does char take?
1 byte (8 bits)
how many bytes does a float take?
4 bytes (32 bits)
how many bytes does a double take?
8 bytes (64 bits)
when is && evaluates to true?
when all of the operands evaluate to true
when is || evaluate to true?
when only one condition is true
what happens when you don’t break in switch case?
u fall down the cases after one of them evaluates to true
how many steps in compiling?
preprocessing:
copies functions prototypes any #include to current file
compiling:
converts source code to assembly code
assembling:
converts assembly code to machine code zeros and ones
linking:
links our zeros and ones to the original C language zeros and ones and other libraries
what is an array?
a sequence of contiguous values stored back to back
can u initialize an array with a variable?
no it must be a constant