0
0
Cprogramming~10 mins

Storage size overview in C - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare a variable that uses 1 byte of storage.

C
unsigned char [1] = 255;
Drag options to blanks, or click blank then click option'
Ax
Ba
Cvar1
DbyteVar
Attempts:
3 left
💡 Hint
Common Mistakes
Using int which usually uses 4 bytes.
Using variable names that are not descriptive.
2fill in blank
medium

Complete the code to declare a variable that uses 4 bytes of storage.

C
int [1] = 1000;
Drag options to blanks, or click blank then click option'
Avalue
Bcount
Cnum
Dtotal
Attempts:
3 left
💡 Hint
Common Mistakes
Using char which uses 1 byte.
Using variable names that are too generic.
3fill in blank
hard

Fix the error in the code to correctly declare a 2-byte storage variable.

C
short [1] = 32000;
Drag options to blanks, or click blank then click option'
AshortVar
Bsh
Cs
DvarShort
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names that are too short or unclear.
Confusing short with int.
4fill in blank
hard

Fill both blanks to declare a variable with 8 bytes storage and assign a large number.

C
[1] [2] = 9223372036854775807LL;
Drag options to blanks, or click blank then click option'
Along long
Bint
CbigNum
Dlong
Attempts:
3 left
💡 Hint
Common Mistakes
Using int which is usually 4 bytes.
Using variable names that don't describe the value.
5fill in blank
hard

Fill all three blanks to declare a floating-point variable with 8 bytes storage and assign a value.

C
[1] [2] = [3];
Drag options to blanks, or click blank then click option'
Adouble
Bpi
C3.141592653589793
Dfloat
Attempts:
3 left
💡 Hint
Common Mistakes
Using float which is 4 bytes.
Using unclear variable names.