1
232
34543
4567654
can anyone tell me how to slove this c question

Answer Posted / karthick

public class Num
{
public static void main(String[] args)
{
for(int i=1;i<=9;i++)
{
for(int l=9;l>=i;l--)
{
System.out.print(" ");
}
for(int j=i;j>=1;j--)
{

System.out.print(j);
if(j==1)
{
for(int k=2;k<=i;k++)
{
System.out.print(k);
}
}

}
System.out.println(" ");
}
System.out.println("-------------------");


for(int m=9;m>=1;m--)
{
for(int n=9;n>=m;n--)
{
System.out.print(" ");
}
for(int o=m;o>=1;o--)
{
System.out.print(o);
if(o==1)
{
for(int r=2;r<=m;r++)
{
System.out.print(r);
}
}

}System.out.println("");
}
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is time complexity c?

568


write a program for the normal snake games find in most of the mobiles.

1786


Explain why c is faster than c++?

575


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1489


how many errors in c explain deply

1631






Explain what is the benefit of using an enum rather than a #define constant?

724


What is structure packing in c?

608


What is a memory leak? How to avoid it?

577


How do you determine a file’s attributes?

602


What is bubble sort in c?

639


What is floating point constants?

693


How to implement a packet in C

2398


When can you use a pointer with a function?

568


What is meant by inheritance?

634


What does sizeof function do?

614