Flowchart (ISO 5807)
Source code
Java
static int diagonalSum(int[][] a, int n) {
int sum = 0;
for (int i = 0; i < n; i++) {
sum += a[i][i];
}
return sum;
}The editor opens with this code — change it and the chart redraws.
- Language
- Java
- Constructs
- loop over diagonal
- Topic
- Loops
- Formats
- Word, Visio, draw.io, PDF, SVG