PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Am required to use while loop ,if statement and the modulus operator together to generate the following numbers exact rows of numbers
123456789101112131416161718192021222324252627282930313233343526373840 and all they are bold
And underlined except for 10 20'30 and 40
So i must produce the same output.
The modulus part isn't right - you need to check every 10th number. Otherwise you have the right code structure so far (but incorrect syntax, of course).
Did you have any specific questions about the code?
You know you are going to have to put some effort into this yourself, right?
Bold and underline is really simple. How about you Google how to do that in HTML?
As for your code, you will be outputting every number. Each one will be bold so that's easy. That if with the modulus: if you add an else block in there then you can use it to decide whether to show the bold version or the bold-and-underlined version of a number.
You're about three lines of code away from the solution.