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
Write a code of a general series where the next element is the sum of last k terms.
What is integer constants?
What is struct node in c?
Why is %d used in c?
What is ctrl c called?
How can I find the modification date of a file?
Explain c preprocessor?
What is null character in c?
What is strcpy() function?
write a program in c language to print your bio-data on the screen by using functions.
Sir i need notes for structure,functions,pointers in c language can you help me please
Write a code to generate divisors of an integer?
Explain what is the best way to comment out a section of code that contains comments?
How can you determine the size of an allocated portion of memory?
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