How many times can a variable be defined? Explain.
How is an assignment statement different from a variable definition?
What is the difference between a variable and a type?
How many times can a variable be defined? Explain.
How is an assignment statement different from a variable definition?
What is the difference between a variable and a type?
I think your trying to solve your assignment so something similar!
Anyways, here is your answer:
How many times can a variable be defined? - You can define infinite number of times any variable, provided its not a global variable and also each of the variable has its own block.
How is an assignment statement different from a variable definition? - When a variable is defined/declared, a small amount of area of your memory is reserved for that variable and a junk value is stored. However, when you assign a value to a variable, this junk value gets replaced with this.
What is the difference between a variable and a type? - I hope you mean data type here. A variable is a symbolic name given to some known or unknown quantity or value, for the purpose of allowing the name to be used independently of the value it represents. A data type is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, stating the possible values for that type, the operations that can be done on that type, and the way the values of that type are stored.
Bookmarks