Notice: To create a variable, we should remember these steps:
- Thinking of a good name
- Putting a dollar sign ($) in front of the name.
- Using equals sign (=) after the name to assign a literal value to that variable and put the value in quotation marks.
- Assigning the value to a variable is an instruction and should be terminated with a semicolon (;).
Variable names can be recognized by:
- They begin with a dollar sign ($)
- can not begin with a numeric character
- can contain numbers and the underscore (_) character
- they are case sensitive.
- Scalar variables contain 1 value at a time
- Array contains a list of values or even another array.
- Integer: whole number (without decimals)
- Floating point numbers ("float" or "double"): number with decimals
- String: text or numeric information, specified within double quotes (" ") or single quote (' ').
and result
No comments:
Post a Comment