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 many data structures are there in c?
Why do we need arrays in c?
How can I read data from data files with particular formats?
what is uses of .net
What are the Advantages of using macro
Who is the founder of c language?
How can a process change an environment variable in its caller?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What are pointers? What are different types of pointers?
What happens if header file is included twice?
Why shouldn’t I start variable names with underscores?
What is use of pointer?
How many bytes are occupied by near, far and huge pointers (dos)?
How can I pad a string to a known length?
Explain how can I avoid the abort, retry, fail messages?