jweinst1
1/21/2016 - 2:54 AM

3 by 3 array in c

3 by 3 array in c

#include "stdio.h"

//makes a 3 by 3 matrix and prints them all out
int main(void) {
    // Disable stdout buffering
    setvbuf(stdout, NULL, _IONBF, 0);
    int i, j;
    int machine[3][3];
    for(i=0;i<3;i++) for(j=0;j<3;j++) machine[i][j] = 0;
    machine[0][2] = 100;
    for(i=0;i<3;i++) for(j=0;j<3;j++) printf("%d", machine[i][j]);

    return 0;
}