Question

Php

Write a php program to print the even numbers between 50 and 100 

1 0
Add a comment Improve this question Transcribed image text
Answer #1
for ($i = 50; $i <= 100; $i++) {
   if ($i % 2 == 0) {
       echo $i . "<br>";
   }
}


answered by: codegates
Add a comment
Know the answer?
Add Answer to:
Php
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
  • 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

  • Can someone help me with this PHP code thank you in advance!! Write a PHP program...

    Can someone help me with this PHP code thank you in advance!! Write a PHP program to print the first 10 terms of a Fibonacci sequence. You need to use arrays to store and print the terms. In the Fibonacci sequence, the next number is found by adding up the two numbers before it. The Fibonacci Sequence starts with 0 and 1 as the first two terms. So F[0]=0 and F[1]=1 and the series propagates such that F[n]= F[n-1]+F[n-2]. The...

  • 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...

  • Identify and correct the error in each of the following PHP code examples: a) <?php print(...

    Identify and correct the error in each of the following PHP code examples: a) <?php print( "Hello World" ); > b) <?php $name = "Paul"; print( "$Name" ); ?> Describe how input from an HTML5 form is retrieved in a PHP program. Describe how cookies can be used to store information on a computer and how the information can be retrieved by a PHP script. Assume that cookies are not disabled on the client.

  • Write a Java program in Eclipse. . Write a Java program that: 1. Creates an array...

    Write a Java program in Eclipse. . Write a Java program that: 1. Creates an array of 100 integers. Initialize the array to have all zeros. 2. Puts even numbers starting from 6 (excluding multiples of 12) into the first 50 slots of the array above. So numbers 6,8,10,14,16,18,20,22,26, etc. go into the first 50 positions in the array. Print the array. 3. Puts random numbers between 45 and 55 into the second 50 slots of the array above (second...

  • Write a program that check odd / even numbers (from number 1 to 100). Display the...

    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 inside HTML code. For example: <html> <title>CHECK ODD or EVEN</title> <body> <table> ?php echo "<tr><td>l</td><td>Odd</td</tr>"; </table> </body </html 2. Do the following steps in...

  • PLEASE DO BOTH OF THESE IN PYTHON!!! AND MAKE SURE THAT I CAN COPY THE CODE....

    PLEASE DO BOTH OF THESE IN PYTHON!!! AND MAKE SURE THAT I CAN COPY THE CODE. 1.) Exercise #1: Design and implement a program (name it PrintSum) that prompts the user for an integer values between 1 and 100. The program then uses a while loop to determine and print out the sum of all values between 1 and the entered value. The program rejects invalid input values with proper message such “Invalid Input. Try again.” Document your code and...

  • مرحبا ممكن حل هذا السؤال ضروري لمادة البرمجه ضروري Q4/ Answer two of the following:- 10...

    مرحبا ممكن حل هذا السؤال ضروري لمادة البرمجه ضروري Q4/ Answer two of the following:- 10 points 04// answer two of the following:- 1- Write and draw an algorithm to print all even numbers between (20) and (50). 2- Write program in c++ to find the maximum between three numbers. 3- Write program in c++ to print the days of week as number from(1 to 7) then print out the corresponding day in this week using (while...loop) 1 Add file

  • Use php Create a file to write a program of 30 city name and populations Using...

    Use php Create a file to write a program of 30 city name and populations Using two files Print using associative array Output should be like Cities: Name. Population Daka. 13 millions

  • write program above in C only Write a program to find statistics on some random numbers....

    write program above in C only Write a program to find statistics on some random numbers. Seed the random number generator with time. In a for loop generate 12 random numbers between the values of 2 and 20. Print the numbers. As the numbers are generated, find the following: the number of even numbers (those evenly divisible by 2) e the sum of the even numbers the product of the even numbers the maximum value of all the numbers e

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