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 |
When is a conditional statement ended with an endif?
Explain what is the difference between mysql_fetch_array() and mysql_fetch_assoc()?
What is difference between mysqli and mysql?
Describe session in php.
How to find current date and time?
What is mod_php?
What is putenv?
How to remove leading and trailing spaces from user input values in php?
Write a program using while loop?
What is $_session in php?
Tell me what does pear stands for?
Tell me how is it possible to return a value from a function?