Level 1. Introduction to C 1.2. Basics Your computer can memorize things One of the things that you can make your computer remember is integer numbers. As one would do in math, you can assign numbers to variables (usually to reuse them later on when needed). Roughly speaking, this is how computers remember things. You use a variable to make a computer remember a number. You may ask why there needs to be a variable to remember a number. Well, let's imagine that you were to be given multiple facts to memorize. For simplicity, I'll only assume two of them: Alice is 3 years old, and Bob is 5 years old. Now, you are asked about Bob's age. If you didn't associate 3 and 5 with the names Alice and Bob, respectively, then you wouldn't be able to answer this question with certainty. So, your mind probably did something similar to what we do in math -- use variables to represent those numbers, that is, Alice = 3 and Bob = 5 . That's why you were able to answer...
Comments
Post a Comment