#include <stdio.h>

int hap(int);
void main(void){
    int i, tot=0;
    for(i=0; i<3; i++) tot = tot + hap(i);
    printf("%d\n", tot);
}
int hap(int i){
    static int a[3][4]={{1,2,3,0}, {4,5,6,0}, {7,8,9,0}};
    int j, sum=0;
    for(j=i; a[i][j]!=0; j++)
        sum=sum+a[i][j];
    return sum;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: