00:01
We want to write a bare -bones program that places the x power of 2 in the variable z.
00:07
In other words, z equals 2 to the x.
00:11
Let's see what this would look like with different values of x.
00:15
If x equals 0, z will equal 2 to the 0 or 1.
00:24
If x is 1, z is 2 to the 1 or 2.
00:29
If x is 2, z is 2 to the 2, which equals 4, and so on.
00:38
For x is 3, z is 4.
00:41
For x is 4, z is 16, and so on, where z is going to double every time x goes up by 1.
00:51
So for a bare -bones program, we can have a variable incrementing until it hits x.
00:57
And every time that variable increments, we find a way to double z.
01:04
So let's start by defining a variable.
01:07
We can call it a, and we set that to 0 with clear a.
01:14
Then, while a is not equal to x, we're going to double z and increment a...