how can i make a program with this kind of output..
Enter a number: 5
0
01
012
0123
01234
012345
01234
0123
012
01
0
Answer Posted / salvin
A much more simpler implementation....
public class Test
{
public static void main(String[] args)
{
int no=5;
for(int n=0;n<=no;n++){
for(int m=0;m<=n;m++){
System.out.print(m);
}
System.out.println();
}
for(int n=no;n>=0;n--){
for(int m=0;m<n;m++){
System.out.print(m);
}
System.out.println();
}
}
}
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are the disadvantages of a shell structure?
Differentiate between the expression “++a” and “a++”?
what is a function method?give example?
i have a written test for microland please give me test pattern
Can we assign integer value to char in c?
How can I change their mode to binary?
Do you know what are bitwise shift operators in c programming?
What are the standard predefined macros?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is formal argument?
When should a far pointer be used?
The difference between printf and fprintf is ?
Explain spaghetti programming?
How can I access an I o board directly?
What are loops c?