Professional Documents
Culture Documents
Answer:
<?php
$a=5;
if ($a%2==0)
{
echo “ This number is even”;
}
else
{
echo “ This number is odd”;
}
?>
2)Write a PHP script to Swap Two Variables3
3)Write a PHP script to Convert Kilometers to Miles
m=kilo * 0.621371
4)Write a PHP script to Check Vowel or consonant
5)Write a PHP script to Check Positive or Negative Using
if...else
6)Write a PHP script to initialize a variable and then
increment its value by 3.
7)Write a PHP program to check two given integers
whether either of them is in the range 100..200
inclusive.
Sample Input:
100,199
250,300
105, 190
8)Write a PHP code for conversion from the Dollars-to-
Euros (Exchange rate 1 USD=0.8467 Euro).
9)Write a PHP script that accepts a temperature value in
Celsius (C) through a web form and converts it to the
Fahrenheit (F) scale. The conversion formula to use is:
F = (9/5) * C + 32.