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
How can I sort more data than will fit in memory?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What is the scope of an external variable in c?
How can I find the modification date of a file?
Is there a way to jump out of a function or functions?
Explain what is meant by high-order and low-order bytes?
What is difference between array and structure in c?
How many levels of indirection in pointers can you have in a single declaration?
Can you please explain the difference between malloc() and calloc() function?
How do I create a directory? How do I remove a directory (and its contents)?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What does c mean before a date?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
When should the register modifier be used? Does it really help?