All simulations
Programming in C
·
Variables and data types
C Variables in Memory
Run a C program line by line and watch its bytes.
+
−
Ready
1/7
Step
4
Bytes in use
0
Lines printed
age · int
gpa · float
pi · double
grade · char
This step
Byte changed
Released
Skip tour
Next
Quiz · C Variables in Memory
Question 1 of 5
Choose one
How many bytes does a double use here?
1
4
8
16
Choose one
char grade = 'A'; stores which byte?
0x0A
0x41
0x61
0x65
Choose one
On a little-endian machine, int age = 20 is stored at 0x1000–0x1003 as:
00 00 00 14
14 00 00 00
20 00 00 00
00 00 14 00
Choose one
What does age = age + 1; do to memory?
Reserves 4 new bytes for the result
Overwrites the same 4 bytes at age’s address
Moves age to a new address
Frees age and creates it again
Select all that apply
Which printf specifiers match their variables?
%d for int age
%c for char grade
%.2f for float gpa
%d for double pi
To improve
Your answers