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 Help Members By Posting Answers For Below Questions

please explain every phase in the "SDLC" in the dotnet.

2165


what do you mean by enumeration constant?

586


How do you convert strings to numbers in C?

695


What is use of #include in c?

584


Are there any problems with performing mathematical operations on different variable types?

556






Why string is used in c?

566


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

646


What is the difference between void main and main in c?

607


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2968


Explain what is the use of a semicolon (;) at the end of every program statement?

714


how to write a c program to print list of fruits in alpabetical order?

1769


What is nested structure with example?

610


What do you mean by dynamic memory allocation in c?

635


How do you initialize pointer variables?

592


What is pointers in c with example?

568