Sunday, February 1, 2015
Read input from keyboard entry and print on console in C
#include <stdio.h>
void main()
{
int a[3][3], i, j;
printf("\n\t Enter matrix of 3*3 : ");
for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{
scanf("%d",&a[i][j]); //read 3*3 array
}
}
printf("\n\t Matrix is : \n");
for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{
printf("\t %d",a[i][j]); //print 3*3 array
}
printf("\n");
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment