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
The __________ attribute is used to announce variables based on definitions of columns in a table?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Write a C program in Fibonacci series.
What are the types of macro formats?
what are bit fields in c?
What are static variables in c?
What is typedef example?
What is an expression?
What is selection sort in c?
Calculate 1*2*3*____*n using recursive function??
write a program to generate address labels using structures?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What is s in c?
Is c dynamically typed?
How to define structures? ·