Download presentation
Presentation is loading. Please wait.
Published byPhoebe Lamb Modified over 6 years ago
1
PHP-language, loops Jouni Juntunen Oulu University of Applied Sciences
School of Business and Information Management
2
Loops While For …
3
Example Print HTML-table using for
4
While initialization while (condition) { //one or more statemens incrementation }
5
Example Calculating compound interest using while
<? $loan=100; $interest=10; $years=3; $i=0; while ($i < $years) { $loan=$loan+ ($loan / 100) * $interest; $i++; } print ”Total amount of loan is $loan”; ?>
6
For For (initialization;condition;increment) { //one or more statemens }
7
Example Calculating compound interest using for
<? $loan=100; $interest=10; $years=3; for ($i=0;$i<$years;$i++); { $loan=$loan + ($loan / 100) * $interest; } print ”Total amount of loan is $loan”; ?>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.