C Program to Print only even data in 2D array.

Print only even data in 2D array.

   Matrix [5][5]



#include<stdio.h>
#include<conio.h>
 void main( )
 {
  int arr[5][5], i , j ;
   clrscr( );
for( i=0;  i<5;  i=i+1 )
{
  for( j=0;  j<5;  j=j+1 )
  { 
   printf("Enter data ");
   scanf("%d",& arr[i][j]);
   }
  printf("\n");
  }
for( i=0;  i<5;  i=i+1 )
{
 for(j=0;  j<5;  j=j+1 )
 {
  if(arr[i][j]%2==0)
   {
    printf("%d",arr[i][j];
     }
   }
}
getch( );
}

Post a Comment

0 Comments