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

Write a code of a general series where the next element is the sum of last k terms.

585


What is integer constants?

609


What is struct node in c?

612


Why is %d used in c?

559


What is ctrl c called?

587






How can I find the modification date of a file?

696


Explain c preprocessor?

678


What is null character in c?

684


What is strcpy() function?

652


write a program in c language to print your bio-data on the screen by using functions.

6239


Sir i need notes for structure,functions,pointers in c language can you help me please

1941


Write a code to generate divisors of an integer?

630


Explain what is the best way to comment out a section of code that contains comments?

710


How can you determine the size of an allocated portion of memory?

736


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

759