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 are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
Which Scripting Engine PHP uses?
How to execute a php script from the command line?
what are in image creating functions in php
Is age an interval or ratio?
how to uploade video in php????
code to see the priview of the image which is being uploaded (after browising the image... just click priview ... how it will be visible...before uploading)
How to get the number of characters in a string?
How to send Email using PHP with MySQL in Linux Server?..
What is PHP? Who is the father or inventor of PHP?
what is difference between PHP4 , PHP5
What is difference between include,require,include_once and require_once()?