Question
  1. Write a program that check odd / even numbers (from number 1 to 100). Display the results within an HTML table with 2 columns: one for odd number and one for even numbers.

NUMBERS RESULTS ODD EVEN ODD 2 HINT: use <table> tags to create a table, <th> tags for Numbers and Results. Wrap code PHP

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

1)

<html>

<title>CHECK ODD or EVEN</tile>

<body>

<table>

<?php

echo "<tr><th>NUMBERS</th><th>RESULT</th></tr>";

for($i=1; $i<=100; $i++){

echo "<tr><td>".$i."</td><td>".($i%2==0?"EVEN":"ODD")."</td></tr>";

}

?>

</table>

</body>

</html>

2)

<?php

$arr = array("key1"=>"value1", "key2"=>"value2", "key3"=>"value3", "key4"=>"value4", "key5"=>"value5", "key6"=>"value6", "key7"=>"value7", "key8"=>"value8");

var_dump($arr);

?>

<html>

<title>CHECK ODD or EVEN</tile>

<body>

<table>

<tr><th>Key</th><th>Value</th></tr>

<?php

foreach($arr as $key=>$val){

echo "<tr><td>".$key."</td><td>".$val."</td></tr>";

}

?>

</table>

</body>

</html>

<?php

asort($arr);

var_dump($arr);

unset($arr['key3']);

var_dump($arr);

?>

Add a comment
Know the answer?
Add Answer to:
Write a program that check odd / even numbers (from number 1 to 100). Display the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Print out information of PHP use phpinfo() function. 2. Write a program that check and...

    1. Print out information of PHP use phpinfo() function. 2. Write a program that check and print odd / even numbers (from number 1 to 100 using for/while loop). Display the results within an HTML table with 2 columns as shown below: NUMBERS RESULTS 1 ODD 2 EVEN 3 ODD HINT: use <table> tags to create a table, <th> tags for ‘Numbers’ and ‘Results’. Wrap code PHP inside HTML code. For example: ​<html> ​​<title>CHECK ODD or EVEN</title> ​​<body> ​​​<table> ​​​​<?php...

  • Hello, Using HTML/Javascript, can somebody help me create an array and fill with random numbers 1-100,...

    Hello, Using HTML/Javascript, can somebody help me create an array and fill with random numbers 1-100, per the number entered in the "Create Array" box of my html, and have it display when the "Create Array" box is clicked? Here is the HTML for this portion: Thank you! <table style="width: 850px; height: 154px;" border="0"> <tbody> <tr> <td>Enter Array Size:<input style="width: 50px;" type="textbox" value="100" /><input type="button" value="Create Array" /></td> </tr> This is what the HTML looks like: Enter Array Size:100 Create...

  • Design a program using Python and using from flask Import flask that generates a lottery number...

    Design a program using Python and using from flask Import flask that generates a lottery number but in a website.. The program should have an Integer array with 9 elements. Write a loop that steps through the array, randomly generating a number in the range of 0 through 42 for each element. (Use the random function) Then write another loop that displays the contents of the array. Each number should be displayed as a list, the numbers should be generated...

  • Write a PHP program using to display all the even numbers between 1 and 100

    Write a PHP program using to display all the even numbers between 1 and 100

  • Q1. rewrite the exercise on April 4 by adding the following operations: 1) In the php...

    Q1. rewrite the exercise on April 4 by adding the following operations: 1) In the php script, create an associative array named $order that stores the following values: - the number of cheese toppings; - the number of pepperoni toppings; - the number of ham toppings; - the size of the ordered pizza; - the number of the ordered pizza; - the total cost of the order; - the discount rate; - the total cost after the discount. 2) the...

  • Create a program that will determine the even number(s) from a list of numbers. Your program...

    Create a program that will determine the even number(s) from a list of numbers. Your program should create and call a function FindEven that accepts a list of numbers and returns a list of only the even numbers in sorted order. Note that the original list is given in the starter code. def body(): numberlist = [1, 1000, 5, -3, 2, 16 # Write your code here and notice level # Do NOT include: if __name__ == been provided for...

  • Write a program in javascript, that take numbers from 1….20 in an array. Separate Even and...

    Write a program in javascript, that take numbers from 1….20 in an array. Separate Even and Odd numbers by using conditional statement. Figure # 01 is the output of this file on web browser. Example: Odd Number = 1 Even Number = 2 Odd Number = 3 Even Number = 4 Odd Number = 5 Even Number = 6 Odd Number = 7 Even Number = 8 Odd Number = 9 Even Number = 10 Odd Number = 11 Even...

  • C languge please ! 1. Using the random number program, fill up an array with 100...

    C languge please ! 1. Using the random number program, fill up an array with 100 random numbers between -30 and 30 and display it. Find out how many of those numbers in the array are positive, negative, even and odd. Display the results. Make sure you cover the special case. Your entire code should have only 1 FOR loop. You will not receive any credit if you use more than 1 loop. (50 points - 5pts for commenting and...

  • Program Requirements First, find all the prime numbers between 2 and a user-inputted number from the...

    Program Requirements First, find all the prime numbers between 2 and a user-inputted number from the console (inclusive). The identified prime numbers must be stored in an array . The inputted number should be between 0 and 1000 (inclusive). array is large enough to o Make sure your hold all the prim e numbers. Dynamic memory allocation is not required for this assignment, so you can have unused space in your array Make sure you can handle the cases of...

  • Python Help Create a program that outputs a table from 1 to 5 using what you've...

    Python Help Create a program that outputs a table from 1 to 5 using what you've learned about "for" loops. Your program will print the number and indicate if the number is odd or even. If it is not odd you will multiply 2 numbers with it: number 1 and number 2. Your program must do the multiplication for only even numbers in the table. The output of your program should look like the figure below. Hint: Create a program...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT