0
0
Cprogramming~5 mins

Basic data types - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a data type in C?
A data type in C tells the computer what kind of data a variable can hold, like numbers or characters.
Click to reveal answer
beginner
Name the four basic data types in C.
The four basic data types in C are int (for whole numbers), float (for decimal numbers), char (for single characters), and double (for double precision decimal numbers).
Click to reveal answer
beginner
What is the difference between int and float?
int stores whole numbers without decimals, while float stores numbers with decimals (fractional parts).
Click to reveal answer
intermediate
How much memory does a char usually take in C?
A char usually takes 1 byte of memory, enough to store one character.
Click to reveal answer
intermediate
Why do we use double instead of float sometimes?
double stores decimal numbers with more precision and uses more memory than float. Use it when you need more accurate decimal values.
Click to reveal answer
Which C data type is used to store whole numbers?
Aint
Bfloat
Cchar
Ddouble
What data type would you use to store a single letter?
Aint
Bchar
Cfloat
Ddouble
Which data type uses more memory and stores more precise decimal numbers?
Adouble
Bfloat
Cchar
Dint
How many bytes does a char usually take?
A4 bytes
B8 bytes
C2 bytes
D1 byte
Which data type would you choose to store the number 3.14?
Aint
Bchar
Cfloat
Dint and char
Explain the main differences between int, float, char, and double in C.
Think about what kind of data each type holds and their precision.
You got /4 concepts.
    Why is it important to choose the correct data type when declaring a variable in C?
    Consider how data type affects memory and accuracy.
    You got /4 concepts.