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

Do you know the difference between malloc() and calloc() function?

587


process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,

1862


Explain how can I make sure that my program is the only one accessing a file?

597


What is the most efficient way to count the number of bits which are set in an integer?

564


What are near, far and huge pointers?

621






Differentiate between static and dynamic modeling.

591


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

643


What is static volatile in c?

546


What is the difference between the expression “++a” and “a++”?

626


In a byte, what is the maximum decimal number that you can accommodate?

601


What is the use of linkage in c language?

590


Tell me can the size of an array be declared at runtime?

570


List out few of the applications that make use of Multilinked Structures?

1239


How can you check to see whether a symbol is defined?

568


What is s in c?

580