answersLogoWhite

0

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

16y ago

Still curious? Ask our experts.

Chat with our AI personalities

DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan

Add your answer:

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