1 0 0
2 3 0
4 5 6
public class arraydemotriangleAmin {
static void triangleAmin(int x[][])
{
int i,j,min=0;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{min=x[0][0];
if(i<=j)
{
if(x[i][j]
min=x[i][j];
}
}
}
}
System.out.println("The Min Value in triangle A is:"+ min);
}
public static void main(String[] args)
{
triangleAmin(new int[][]{{1,2,3},{4,5,6},{7,8,9}});
}
}
No comments:
Post a Comment