12344321
123 321
12 21
1 1 how i print this program??
Answer Posted / harika
package basic_java_examples;
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 ? | 4 Yes | 1 No |
Post New Answer View All Answers
Can a variable be both const and volatile?
What does struct node * mean?
Explain what is the difference between #include and #include 'file' ?
Are pointers integers in c?
Not all reserved words are written in lowercase. TRUE or FALSE?
Can a void pointer point to a function?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
How can you convert integers to binary or hexadecimal?
Write a program to check whether a number is prime or not using c?
Describe the modifier in c?
What is function prototype?
what does static variable mean?
What is the difference between text and binary i/o?
Explain the difference between getch() and getche() in c?
Write a program to reverse a string.