/**
Pattern-7:
Enter N : 5
13579
13579
13579
13579
13579
*/
import java.io.*;
public class Pattern7
{
public static void main(String args[])throws IOException
{
int i, j, n;
InputStreamReader read = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(read);
System.out.print("Enter N : ");
n=Integer.parseInt(in.readLine());
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
System.out.print(j*2-1);
}
System.out.println();
}
}
}
Pattern-7:
Enter N : 5
13579
13579
13579
13579
13579
*/
import java.io.*;
public class Pattern7
{
public static void main(String args[])throws IOException
{
int i, j, n;
InputStreamReader read = new InputStreamReader(System.in);
BufferedReader in = new BufferedReader(read);
System.out.print("Enter N : ");
n=Integer.parseInt(in.readLine());
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
System.out.print(j*2-1);
}
System.out.println();
}
}
}
No comments:
Post a Comment