Write a Java Program to accept minimum value as 10 and maximum value as 40 and print matrix as [11,12,13,21,22,23,31,32,33] | EasyCoding45
Write a Java Program to accept minimum value as 10 and maximum value as 40 and print matrix as [11,12,13,21,22,23,31,32,33] | EasyCoding45
Write a Java Program to accept minimum value as 10 and maximum value as 40 and print matrix as [11,12,13,21,22,23,31,32,33].
In this tutorial, we are going to learn how we can write a Java Program to accept minimum value as 10 and maximum value as 40 and print matrix as [11,12,13,21,22,23,31,32,33].
Program:- (Java Program to accept minimum value as 10 and maximum value as 40 and print matrix as [11,12,13,21,22,23,31,32,33] )
import java.util.*;
public class ShowMatrix{
public void showMatrix(int min, int max)
{
System.out.println("Format Matrix is :");
for(int i=min+1;i<max;i=i+7)
{
for(int j=0;j<3;j++)
{
System.out.print(i+"\t");
i++;
}
System.out.println();
}
}
public static void main(String args[])
{
int min=10;
int max=40;
ShowMatrix s=new ShowMatrix();
s.showMatrix(min,max);
}
}
Output :-
Comments
Post a Comment