Numeric constant vs alphanumeric constant
Answers
Answered by
2
Hope it may be helpful
Constants
Numeric Constant
May have sign in front of number
May have decimal point
No commas, dollar signs, percent signs
May be used in calculations
Examples of numeric constants
5 4.5 -7
Nonnumeric Constant
Anything enclosed in quotation marks is considered a Nonnumeric constant, also called string constants or alphanumeric constants or literals
Nonnumeric constants SHOULD NOT be used in calculations
Examples of nonnumeric constants
“Hello World” “5” “Five” “”
Note: Quotes with nothing, not even a space between them are called a zero-length string or empty string
Constants
Numeric Constant
May have sign in front of number
May have decimal point
No commas, dollar signs, percent signs
May be used in calculations
Examples of numeric constants
5 4.5 -7
Nonnumeric Constant
Anything enclosed in quotation marks is considered a Nonnumeric constant, also called string constants or alphanumeric constants or literals
Nonnumeric constants SHOULD NOT be used in calculations
Examples of nonnumeric constants
“Hello World” “5” “Five” “”
Note: Quotes with nothing, not even a space between them are called a zero-length string or empty string
Similar questions