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
Explain how do you determine whether to use a stream function or a low-level function?
Explain bit masking in c?
What are variables c?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
What is the difference between single charater constant and string constant?
Is c compiled or interpreted?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
write a program fibonacci series and palindrome program in c
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Explain how can you restore a redirected standard stream?
What is character set?
What are the string functions? List some string functions available in c.
Tell us two differences between new () and malloc ()?
How can my program discover the complete pathname to the executable from which it was invoked?
What is a const pointer in c?