| | |
Please advice how the follwoing code works
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 38
Reputation:
Solved Threads: 0
I dun quite understand how this program works.......
Please advice...
What is the output of this program?
Please advice...
Thanks,
Tony
Please advice...
What is the output of this program?
PHP Syntax (Toggle Plain Text)
<html> <!-- test01.php --> <body> <?php $x = 2; for ($i = 1; $i <= 6; $i++) { if ($i % 2 == 1) { $x++; } print $i . 'x' . $i * $x . " "; } ?> </body> </html> ******* Answer: 1x3 2x6 3x12 4x16 5x25 6x30
Please advice...
Thanks,
Tony
This sounds like a homework problem to me, maybe you should to a little more studying. Why else would you include the "answer."
•
•
Join Date: Jun 2009
Posts: 38
Reputation:
Solved Threads: 0
This is an example of the kind of question that might appear in the final exam and although I have done 4 weeks of PHP, I dun quite get the reason for the output, which was given by my prof...
•
•
•
•
X = 2 rite,
Then howcome the answer to the code is:
1 x 3, 2 x6, 3 x 12, 4 x16, 5 x 25, 6 x30
x++(shouldn't it be 3, 5, 7, 9, 11, 13)
I am confused...
•
•
•
•
Originally Posted by Blaise Pascal
You always admire what you really don't understand
Last edited by ardav; Jul 20th, 2009 at 1:41 pm.
Happy Humbugging Christmas
Paid รข bod yn wirion, gwranda, rwyt wedi derbyn sawl darn o god yn rhad ac am ddim, cer i wneud gwaith dy hun.
In a word, no.
I think your semester average has been bumped enough already. You get the grades you deserve at the end.
False dawns and dead ends are the making of men. What feeble excuse of a man shall you turn out to be if you continue to complete a crossword by first checking the answers?
Go forth and pound thy books.
In a word, no.
I think your semester average has been bumped enough already. You get the grades you deserve at the end.
False dawns and dead ends are the making of men. What feeble excuse of a man shall you turn out to be if you continue to complete a crossword by first checking the answers?
Go forth and pound thy books.
Happy Humbugging Christmas
![]() |
Similar Threads
- Code works, would appreciate style advice (C++)
- Integer partition: code works - any suggestion to improve it? (C++)
- Code works with Mozilla, but not with other browsers... (PHP)
- Need general, esoteric advice on C++ in the real world.. (C++)
- How this code works??? (C)
- need help with my code (C++)
- Short code - it works on VC++ Express but not on Bloodshed!! (C++)
- ASP Code Works on Local 127.0.0.1 but Not on ISP's Server (ASP)
- Pointer logic advice (C)
Other Threads in the PHP Forum
- Previous Thread: Need Help in Implementing eway payment gateway.
- Next Thread: I'm way out of my depth and need desperate help.
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parse paypal pdf php problem query radio random recursion regex remote script search send seo server sessions sms soap source space sql static structure syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube






