Flowchart (ISO 5807)
Source code
TypeScript
function reverse(n: number): number {
let r = 0;
while (n > 0) {
r = r * 10 + n % 10;
n = Math.floor(n / 10);
}
return r;
}The editor opens with this code — change it and the chart redraws.
- Language
- TypeScript
- Constructs
- while
- Topic
- Loops
- Formats
- Word, Visio, draw.io, PDF, SVG