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 to convert a json string to an array in php?

0 Answers  


what are Implode and Explode functions?

8 Answers   HCL,


Are there regular expressions in php?

0 Answers  


how we can crop an image and how we can display it..

1 Answers   Satyam,


How to get the IP address of the client/user in PHP?

0 Answers  


Explain mysql_errno()?

0 Answers  


How to list all values of submitted fields?

0 Answers  


Define metaphone()?

0 Answers  


Why php is better?

0 Answers  


Write a program to find a string is palindrome or not?

0 Answers  


How to genrate report in wordpress cms

0 Answers  


full form of php??

12 Answers   HCL,


Categories