/**
Pattern-11:
Enter N : 5
5
44
333
2222
11111
*/
import java.io.*;
public class Pattern11
{
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<=i;j++)
{
System.out.print(n-i+1);
}
System.out.println();
}
}
}
Pattern-11:
Enter N : 5
5
44
333
2222
11111
*/
import java.io.*;
public class Pattern11
{
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<=i;j++)
{
System.out.print(n-i+1);
}
System.out.println();
}
}
}
No comments:
Post a Comment