Friday, 25 June 2010

Wap to read an 2d array and display

//wap to read an 2d array and display */
#include<conio.h>
#include<stdio.h>
void main()
{
 int a[2][3];
 int i,j;
 printf("enter the elements in 2d array\n");
 for(i=0;i<=2-1;i++)
 {
  for(j=0;j<=3-1;j++)
  {
   scanf("%d",&a[i][j]);
  }
 }
 printf("2d array is\n");
 for(i=0;i<=2-1;i++)
 {
  for(j=0;j<=3-1;j++)
  {
   printf("%d\t",a[i][j]);
  }
  printf("\n");
 }
 getch();
}
You may like the following posts:
Arrays

No comments:

Post a Comment