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 |
Is null in php?
What is the difference between explode and split?
A process is identified by a unique___
How to check an element is exists in array or not in php?
Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.
What is $this in php?
What is a role of a designer in web development. Till what level the designer will do his work. Does he gives the complete html file or the tpl file or he should also include the smarty tag in the tpl file.
How to get a total number of rows available in the table?
how to insert logout time when browser close
Make a "dynamic drop down list" with using only PHP,HTML and MySQL..
How to remove duplicate values from php array?
Hello Friends,I am seeking for a job in php having 2yrs. exp.Please suggest any company openings.