Flowchart (ISO 5807)
Source code
PHP
function digitSum($n) {
if ($n == 0) return 0;
return $n % 10 + digitSum(intdiv($n, 10));
}The editor opens with this code — change it and the chart redraws.
- Language
- PHP
- Constructs
- recursion over digits
- Topic
- Recursion
- Formats
- Word, Visio, draw.io, PDF, SVG