int main ()
{
int a[5][5],i,j,sum=0;
printf("Enter Matrix (5x5):\n");
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Numbers which are divisible by 10:\n");
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
if(a[i][j]%10==0)
{
printf("%d ",a[i][j]);
sum=sum+a[i][j];
}
}
}
printf("\nSum of numbers which are divisible by 10: %d",sum);
return 0;
}
No comments:
Post a Comment