Write a php code which could be used to generate random
numbers between 1 - 100 and display them on the screen.

Answers were Sorted based on User's Feedback



Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / laxmikant

echo rand(1,100);

Is This Answer Correct ?    29 Yes 0 No

Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / anjithkumar.garapati

<?php
$n=10;//number_of_numbers_required_to_display
$num=rand(1,100);
for($i=0;$i<n;$i++){
echo $num;}
?>

Is This Answer Correct ?    25 Yes 14 No

Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / ashok

<?php
$n=10;//number_of_numbers_required_to_display
$num=rand(1,100);
for($i=0;$i<$n;$i++)
{
echo rand(1,100)."<BR>";
}
?>

Is This Answer Correct ?    9 Yes 1 No

Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / solutio magister

<?php
$n=10;//number_of_numbers_required_to_display
for($i=0;$i<$n;$i++)
{
echo rand(1,100)."<br>";
}
?>

Is This Answer Correct ?    7 Yes 1 No

Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / shankar

<?php
$n=10;//number_of_numbers_required_to_display

for($i=0;$i<$n;$i++){
$num=rand(1,100);
echo $num;?>
<br/>
<?php
}
?>

Is This Answer Correct ?    9 Yes 4 No

Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / yatin

<?php
$n=100; //number_of_numbers_required_to_display

for($i=0;$i<$n;$i++)
{
$num=rand(1,100);
echo $num."<br>";}
?>

Is This Answer Correct ?    4 Yes 0 No

Write a php code which could be used to generate random numbers between 1 - 100 and display them on..

Answer / vipin gurjar

rand(1,100)

Is This Answer Correct ?    3 Yes 5 No

Post New Answer

More PHP Interview Questions

How cookies are trported from browsers to servers?

0 Answers  


Explain what does the function get_magic_quotes_gpc() means?

0 Answers  


Explain me what are the 3 scope levels available in php and how would you define them?

0 Answers  


How do you trim spaces in excel?

0 Answers  


What is the purpose of php?

0 Answers  






What php framework does wordpress use?

0 Answers  


What is the difference between single-quoted and double-quoted strings in php?

0 Answers  


What is array and function?

0 Answers  


Applications written to provide a GUI shell for Unix and Linux are called

0 Answers  


Explain what is the use of "echo" in php?

0 Answers  


Which php framework is fastest?

0 Answers  


what is Opern source?

3 Answers  


Categories