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
What is getch?
What are different types of pointers?
Write a program to swap two numbers without using a temporary variable?
What are keywords in c with examples?
What is meant by 'bit masking'?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What is variable and explain rules to declare variable in c?
What is difference between scanf and gets?
What is sorting in c plus plus?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
What is an endless loop?
What is output redirection?
What are file streams?
What is typedef example?