0% found this document useful (0 votes)
47 views

Write Down PHP Code To Print All ODD Numbers Between 0 and 100. A) Using For Loop B) Using While Loop

1. The document provides code snippets to print equations and define variables. It also describes a function that uses a switch statement to print different messages based on the remainder when dividing an integer by 5. 2. It asks to write code to print all numbers between 0 and 100 using a for loop and while loop. 3. It asks to use nested for loops to create a multiplication table from 1 to 10.

Uploaded by

Thu Vu
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Write Down PHP Code To Print All ODD Numbers Between 0 and 100. A) Using For Loop B) Using While Loop

1. The document provides code snippets to print equations and define variables. It also describes a function that uses a switch statement to print different messages based on the remainder when dividing an integer by 5. 2. It asks to write code to print all numbers between 0 and 100 using a for loop and while loop. 3. It asks to use nested for loops to create a multiplication table from 1 to 10.

Uploaded by

Thu Vu
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Print equations to the browser. In your script, create the following variables: $x=10 $y=!

"rite co#e to print out the following: 10 $ ! = 1! 10 % ! = & 10 ' ! = !0 10 ( ! = 1.)*+,!1)*+,!1) 10 - ! = & .se nu/bers only in the above variable assign/ents, not in the echo state/ents. 0ou will nee# a thir# variable as well. *. 1reate a function that accepts an integer, an# then, outputs a /essage base# on the re/ain#er of that nu/ber when you #ivi#e it by ,. .se a 2switch3 state/ent for the logic. 4or a re/ain#er of 0, print: 56ello7 4or a re/ain#er of 1, print: 56ow are you87 4or a re/ain#er of *, print: 5I3/ #oing well, than9 you7 4or a re/ain#er of &, print: 5:ee you later7 4or a re/ain#er of ), print: 5;oo#%bye7
&. "rite #own P6P co#e to print all <== nu/bers between 0 an# 100. a> .sing for loop b> .sing while loop

). .se two for loops, one neste# insi#e another. 1reate the following /ultiplication table: 1 * & ) , ? ! * ) ? + 10 1* 1) & ? @ 1* 1, 1+ *1 ) + 1* 1? *0 *) *+ , 10 1, *0 *, &0 &, ? 1* 1+ *) &0 &? )* ! 1) *1 *+ &, )* )@

You might also like