⧼exchistory⧽
4 exercise(s) shown, 0 hidden
ABy Admin
May 13'24
- Can a variable name start with a number?
- Can a variable name start with a typographical symbol(e.g. #, *, _)?
- Give an example of a C variable name that would not work. Why doesn't it work?
ABy Admin
May 13'24
- List at least three data types in C
- On your computer, how much memory does each require?
- Which ones can be used in place of another? Why?
- Are there any limitations on these uses?
- If so, what are they?
- Is it necessary to do anything special to use the alternative?
- Can the name we use for a data type (e.g. 'int', 'float') be used as a variable?
ABy Admin
May 13'24
- How would you assign the value 3.14 to a variable called pi?
- Is it possible to assign an int to a double?
- Is the reverse possible?
ABy Admin
May 13'24
- A common mistake for new students is reversing the assignment statement. Suppose you want to assign the value stored in the variable "pi" to another variable, say "pi2":
- What is the correct statement?
- What is the reverse? Is this a valid C statement (even if it gives incorrect results)?
- What if you wanted to assign a constant value (like 3.1415) to "pi2":
- a. What would the correct statement look like?
- b. Would the reverse be a valid or invalid C statement?