Demo entry 1949952

print_matrix

   

Submitted by anonymous on Jun 18, 2015 at 04:41
Language: C. Code size: 385 Bytes.

#include<stdio.h>
int main() {
    double ma[4][4]= {{1.0, 2.0, 3.0, 4.0},
        {5.0, 6.0, 7.0, 8.0},
        {9.0, 10.0, 11.0, 12.0},
        {13.0, 14.0, 15.0, 16.0}
    };
    int row,col;
    for(row=0; row<4; row++) {
        putchar('|');
        for(col=0; col<4; col++)
            printf("%7.2f ",ma[row][col]);
        printf("|\n");
    }
    return (0);
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).