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 ? | 17 Yes | 3 No |
Post New Answer View All Answers
What is an lvalue in c?
Which is best book for data structures in c?
What are the types of macro formats?
What is c mainly used for?
What do you understand by friend-functions? How are they used?
Can include files be nested?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
What are the advantages of c preprocessor?
What is the value of h?
What are qualifiers in c?
How can I direct output to the printer?
What are the advantages of using new operator as compared to the function malloc ()?
What is modifier & how many types of modifiers available in c?
How will you divide two numbers in a MACRO?
What is else if ladder?