elemente pare aflate pe linii impare si coloane divizibile cu 3

#include<iostream.h>
void main()
{
int n,m,i,j,a[20][20];
int nr,nn=0,np=0,no=0;
cout<<“m=”;cin>>m;
cout<<“n=”;cin>>n;
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
{cout<<“a[“<<i<<“][“<<j<<“]=”;cin>>a[i][j];}
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
if(a[i][j]%2==0 && i%2==1 && j%3==0)
cout<<a[i][j]<<” “;
}

{joscommentenable}

Facebook Comments