Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

2d array in c

#include <stdio.h>
int main(){
    int scores[3][3],i,j;
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            printf("a[%d][%d] = ",i,j);
            scanf("%d",&scores[i][j]);
        }
    }

printf("
 Matrix view: 
");
for (i=0;i<3;i++)
{
    for (j=0;j<3;j++){
        printf("%d	",scores[i][j]);
    }
    printf("
");
}
}
Source by riptutorial.com #
 
PREVIOUS NEXT
Tagged: #array
ADD COMMENT
Topic
Name
5+6 =