answersLogoWhite

0

How do you get the square of an integer in PHP?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

printf ("square of %d is %d\n", $n, $n*$n);

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you get the square of an integer in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can you input an integer value in PHP?

<?php $x =1; ?> PHP changes type for you on the fly. If you need to be sure it's an integer (Because PHP isn't doing a good job changing the type) then cast it thusly: <?php $y = (int)$x ?>


Is square of 6 an integer?

Yes; the square of any integer is also an integer.Yes; the square of any integer is also an integer.Yes; the square of any integer is also an integer.Yes; the square of any integer is also an integer.


Will the square of an integer always be an integer?

Yes, the square of an integer is always an integer.


How can I find the biggest integer my computer can handle using PHP?

You may use the following code to see how far you can push your computer via storing integers; the biggest integer allowed in PHP actually depends on the system PHP is running on, and how big of an integer it allows in its memory. It's advised that, if you really want to do this, that you turn off PHP output limiting, so then you don't get an exhaustion error. <?php for ($i = 0; TRUE; $i++) { echo $i; } ?>


Which statement is true the square root of an integer will always be an integer or the square of an integer will always be an integer?

the square of an integer will always be an integer


The square root of an integer will always be an integer?

The square root of an integer is a CYCLOTOMIC integer.


The square root of a perfect square is an integer?

Yes it is.Since the square of an integer is called a perfect square, then the square root of a perfect square must be an integer.


What is a sqare whole number?

That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.That is any number that is an integer, and the square of another integer. For example, 4 is the square of 2, while 9 is the square of 3.


What is a number who square root is an integer called?

The square of that integer.


Is negative 64 square root of an integer?

Negative 64 is the square root of an integer. The square root of -64 is not an integer.


Is the square root of an integer always an integer?

no, the square root of an integer will not always be another integer. take the integer 27, for example. the square root of 27 is about 5.1961, which is not an integer.No eg square root of 17 is 4.1231056...


Will the square root of an integer always be an integer?

No, the square root of an integer will not always be an integer. It may or may not be. The square root of nine is three, both of which are integers. The square root of two is not an integer. In fact, it is not even a rational number.