⧼exchistory⧽
4 exercise(s) shown, 0 hidden
ABy Admin
May 13'24
  1. Can a variable name start with a number?
  2. Can a variable name start with a typographical symbol(e.g. #, *, _)?
  3. Give an example of a C variable name that would not work. Why doesn't it work?
ABy Admin
May 13'24
  1. List at least three data types in C
    1. On your computer, how much memory does each require?
    2. Which ones can be used in place of another? Why?
      1. Are there any limitations on these uses?
      2. If so, what are they?
      3. Is it necessary to do anything special to use the alternative?
  2. Can the name we use for a data type (e.g. 'int', 'float') be used as a variable?
ABy Admin
May 13'24
  1. How would you assign the value 3.14 to a variable called pi?
  2. Is it possible to assign an int to a double?
    1. Is the reverse possible?
ABy Admin
May 13'24
  1. 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":
    1. What is the correct statement?
    2. What is the reverse? Is this a valid C statement (even if it gives incorrect results)?
    3. 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?