12344321
123 321
12 21
1 1 how i print this program??
Answer Posted / guest
public class Numbers {
public static void main(String[] args){
int i,j,n=4;
for(i=0;i<=n;i++){
System.out.println();
for(j=1;j<=n-i;j++)
System.out.print(j);
for(j=0;j<2*i;j++)
System.out.print(" ");
for(j=n-i;j>=1;j--)
System.out.print(j);
}
}
}
Is This Answer Correct ? | 16 Yes | 3 No |
Post New Answer View All Answers
please explain every phase in the "SDLC" in the dotnet.
what do you mean by enumeration constant?
How do you convert strings to numbers in C?
What is use of #include in c?
Are there any problems with performing mathematical operations on different variable types?
Why string is used in c?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What is the difference between void main and main in c?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Explain what is the use of a semicolon (;) at the end of every program statement?
how to write a c program to print list of fruits in alpabetical order?
What is nested structure with example?
What do you mean by dynamic memory allocation in c?
How do you initialize pointer variables?
What is pointers in c with example?