Problem on struct variables in c
#include<stdio.h> struct student{ int rnumber; int r2number; int r3number; }; int average=0; main ( ){ struct student raja[10][10]; struct student *p1=&raja[10][10]; for(int i=0;i<10;i++) { for(int j=0;j<10;j++) { raja[i][j].rnumber=i+j; raja[i][j].r2number=i*j; raja[i][j].r3number=i-j; } } printf("\n%d:%d:%d",raja[1][0].r2number,raja[1][0].rnumber,raja[1][0].r3number); for(int h=0;h<10;h++) { for(int y=0;y<10;y++) { average=(raja[h][y].r2number+raja[h][y].rnumber+raja[h][y].r3number)/3; raja[h][y].rnumber=average; raja[h][y].r2number=average; raja[h][y].r3number=average; } } printf("\n%d:%d:%d:%d",raja[1][0].r2number,raja[1][0].rnumber,raja[1][0].r3number,average); } Output: 0:1:1 0:0:0:33 Why did the average did not assign to struct variables