1.

The generalised syntax for a real number representation is __________(a) [digits][.digits][(E|e)[(+|-)]digits](b) [digits][+digits][(E|e)[(+|-)]digits](c) [digits][(E|e)[(+|-)]digits](d) [.digits][digits][(E|e)[(+|-)]digits]I had been asked this question in class test.Question is taken from Types, Values and Variables topic in chapter Lexical Structures of JavaScript

Answer»

Correct option is (a) [digits][.digits][(E|e)[(+|-)]digits]

The explanation is: Floating-point literals may ALSO be represented using EXPONENTIAL notation: a real NUMBER FOLLOWED by the letter e (or E), followed by an optional PLUS or minus sign, followed by an integer exponent. This notation represents the real number multiplied by 10 to the power of the exponent.



Discussion

No Comment Found

Related InterviewSolutions