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
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 |
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 |
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 |
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 |
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 |
What the use of var_dump()?
Tell me how comfortable are you with writing html entirely by hand?
How the result set of mysql be handled in php?
What is regex in html?
Explain Type juggling?
Tell me what does pear stands for?
What are the differences between PHP 3 and PHP 4 and PHP 5?
What is the difference between include and include_once ? Which is one is good in terms of performance ?
What is a php session?
Tell me what the difference between the 'bitwise and' operator and the 'logical and' operator?
What is the difference between $var and $$var?
Is null or empty c#?