Program to print 1
1 2
1 2 3
1 2 3 4 like that
Answer Posted / aditya
public class pattern
{
public static void main(int n)
{
int i,j,k;
for(i=1;i<=n;i++)
{
for(j=n;j>i;j--)
{
System.out.print(" ");
}
for(k=1;k<=i;k++)
{
System.out.print(+k+" ");
}
System.out.println();
}
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the procedures?
What is a jit compiler?
What is the difference between multiple processes and multiple threads?
What are packages in java?
What do you understand by java?
What is another word for methodology?
What are synchronized methods and synchronized statements in java programming?
how to convert Java project into Maven ?
What is a nullable field?
What are the main uses of this keyword?
Can private method static?
What is the format specifier?
Give the hierarchy of inputstream and outputstream classes.
When can you say a graph to be a tree?
Why is serialization required?