answersLogoWhite

0

What is a number without a variable?

Updated: 10/26/2022
User Avatar

Wiki User

15y ago

Best Answer

In computer programming, a number without a variable is referred to as a "magic number," because it seems to appear out of nowhere (like magic!). This is typically considered a bad thing, as that number will have no implicit meaning.

{

diameter = 10;

area = 3.14 * diameter; // here 3.14 is a magic number

}

{

pi = 3.14

diameter = 10;

area = pi * diameter; // now the meaning of this statement is unambiguous

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a number without a variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp