ARRAY DIAMOND

ARRAY DIAMOND

View Answers

December 23, 2009 at 11:47 AM

Hi Friend,

Try the following code:

class pyramid {
public static void main(String[] args) {
int i,j,r=1;
for(int k=1;k<=6;k++){
System.out.print(k);
}

System.out.print("\n");
for(i=5;i>=1;i--) {
System.out.print(i);
for(j=i-r;j>=1;j--)
System.out.print(j);
System.out.print("\n");
}
}
}

Thanks









Related Tutorials/Questions & Answers:
ARRAY DIAMOND - Java Interview Questions
ARRAY DIAMOND  HI I WANT PRINT LIKE THIS I Want Print In Diamond Shape? 1 2 3 4 5 6 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 I WANT SOURCE CODE?  Hi Friend, Try the following code: class
diamond print
diamond print   print the pattern 1 2 3 4 5 6 7 8 9 10 11 12
Advertisements
ModuleNotFoundError: No module named 'diamond'
ModuleNotFoundError: No module named 'diamond'  Hi, My Python... 'diamond' How to remove the ModuleNotFoundError: No module named 'diamond... to install padas library. You can install diamond python with following command
ModuleNotFoundError: No module named 'diamond'
ModuleNotFoundError: No module named 'diamond'  Hi, My Python... 'diamond' How to remove the ModuleNotFoundError: No module named 'diamond... to install padas library. You can install diamond python with following command
ModuleNotFoundError: No module named 'diamond'
ModuleNotFoundError: No module named 'diamond'  Hi, My Python... 'diamond' How to remove the ModuleNotFoundError: No module named 'diamond... to install padas library. You can install diamond python with following command
in_array
in_array  in_array in php
is _array()
is _array()  is_array() in php   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php $yes = array('Hello', 'World'); echo is_array($yes) ? 'Array
is _array()
is _array()  is _array()   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php $yes = array('Hello', 'World'); echo is_array($yes) ? 'Array
ModuleNotFoundError: No module named 'appenlight-diamond'
ModuleNotFoundError: No module named 'appenlight-diamond'  Hi, My... named 'appenlight-diamond' How to remove the ModuleNotFoundError: No module named 'appenlight-diamond' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'diamond-accounting'
ModuleNotFoundError: No module named 'diamond-accounting'  Hi, My... named 'diamond-accounting' How to remove the ModuleNotFoundError: No module named 'diamond-accounting' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'diamond-next'
ModuleNotFoundError: No module named 'diamond-next'  Hi, My Python... 'diamond-next' How to remove the ModuleNotFoundError: No module named 'diamond-next' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'diamond-next'
ModuleNotFoundError: No module named 'diamond-next'  Hi, My Python... 'diamond-next' How to remove the ModuleNotFoundError: No module named 'diamond-next' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'diamond-patterns'
ModuleNotFoundError: No module named 'diamond-patterns'  Hi, My... named 'diamond-patterns' How to remove the ModuleNotFoundError: No module named 'diamond-patterns' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'diamond-patterns'
ModuleNotFoundError: No module named 'diamond-patterns'  Hi, My... named 'diamond-patterns' How to remove the ModuleNotFoundError: No module named 'diamond-patterns' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'Flask-Diamond'
ModuleNotFoundError: No module named 'Flask-Diamond'  Hi, My... 'Flask-Diamond' How to remove the ModuleNotFoundError: No module named 'Flask-Diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Puppet-Diamond'
ModuleNotFoundError: No module named 'Puppet-Diamond'  Hi, My... named 'Puppet-Diamond' How to remove the ModuleNotFoundError: No module named 'Puppet-Diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Puppet-Diamond'
ModuleNotFoundError: No module named 'Puppet-Diamond'  Hi, My... named 'Puppet-Diamond' How to remove the ModuleNotFoundError: No module named 'Puppet-Diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Puppet-Diamond'
ModuleNotFoundError: No module named 'Puppet-Diamond'  Hi, My... named 'Puppet-Diamond' How to remove the ModuleNotFoundError: No module named 'Puppet-Diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Puppet-Diamond'
ModuleNotFoundError: No module named 'Puppet-Diamond'  Hi, My... named 'Puppet-Diamond' How to remove the ModuleNotFoundError: No module named 'Puppet-Diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pytest-diamond'
ModuleNotFoundError: No module named 'pytest-diamond'  Hi, My... named 'pytest-diamond' How to remove the ModuleNotFoundError: No module named 'pytest-diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'sf-diamond'
ModuleNotFoundError: No module named 'sf-diamond'  Hi, My Python... 'sf-diamond' How to remove the ModuleNotFoundError: No module named 'sf-diamond' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'spud-diamond'
ModuleNotFoundError: No module named 'spud-diamond'  Hi, My Python... 'spud-diamond' How to remove the ModuleNotFoundError: No module named 'spud-diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'whale-diamond'
ModuleNotFoundError: No module named 'whale-diamond'  Hi, My... 'whale-diamond' How to remove the ModuleNotFoundError: No module named 'whale-diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'whale-diamond'
ModuleNotFoundError: No module named 'whale-diamond'  Hi, My... 'whale-diamond' How to remove the ModuleNotFoundError: No module named 'whale-diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Agile-Diamond'
ModuleNotFoundError: No module named 'Agile-Diamond'  Hi, My... 'Agile-Diamond' How to remove the ModuleNotFoundError: No module named 'Agile-Diamond' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'appenlight-diamond'
ModuleNotFoundError: No module named 'appenlight-diamond'  Hi, My... named 'appenlight-diamond' How to remove the ModuleNotFoundError: No module named 'appenlight-diamond' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'diamond-accounting'
ModuleNotFoundError: No module named 'diamond-accounting'  Hi, My... named 'diamond-accounting' How to remove the ModuleNotFoundError: No module named 'diamond-accounting' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'diamond-next'
ModuleNotFoundError: No module named 'diamond-next'  Hi, My Python... 'diamond-next' How to remove the ModuleNotFoundError: No module named 'diamond-next' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'diamond-patterns'
ModuleNotFoundError: No module named 'diamond-patterns'  Hi, My... named 'diamond-patterns' How to remove the ModuleNotFoundError: No module named 'diamond-patterns' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'Flask-Diamond'
ModuleNotFoundError: No module named 'Flask-Diamond'  Hi, My... 'Flask-Diamond' How to remove the ModuleNotFoundError: No module named 'Flask-Diamond' error? Thanks   Hi, In your python
Draw a diamond - Java Beginners
Draw a diamond  I want to draw a diamond shapein java using (*) in 9 lines. Here is the code import java.util.*; public class Diamond { static... the problem : import java.util.*; public class Diamond { static Scanner
How to make a diamond necklace, make a diamond necklace, diamond necklace
How to make a diamond necklace       This tutorial will give you instruction to make draw a diamond necklace, so follow all the steps to make similar. New file: First take a new
Array
Array  how can i use elements of an array in a circular form? that is if the searching of the element reach the last elements of the array, then it will start serching from the begining of the array
Array
Array  is it possible to define array like this..? int[] intArray = new int[] {4,5,6,7,8}; Explain...?   Yes, you can. Java Initialize Array
Array
Array  What if i will not declare the limit index of an array, how will I declare an array and store values with it using loop?   Hi Friend... Scanner(System.in); int array[]=new int[5]; System.out.println("Enter
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
Array
Array  How do i insert elements into an array up to a limit from...("Enter Range: "); int size=input.nextInt(); int array[]=new int[size]; System.out.println("Enter Array Elements: "); for(int i=0;i<
array
array  WAP in java to store 6 element in array P and 4 element in array Q. Produce the third arra y R containing all element from p & q
Diamond Jewelry
Diamond Jewelry Everyone loves diamonds, especially ladies, because besides... a lot more comfortable in special situations. Basically, diamond jewelry... the cheapest diamond jewelry items, you are making a statement. Don't get us
Array
Array  can we create an array of size 1 lakh in java programming
array
array  array memory allocation is dynamic or static in java   Java Arrays have dynamic memory allocation
array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element
array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element
array
array  take a 2d array and display all its elements in a matrix fome using only one for loop and ple explain the program in below
array
accepts a pointer to integer which represents an array of integer.After that this method prints the entire of the array numbers to the monitor. include using std::cout; using std::endl; void printArray(int *array, int count
array
array  How to store the results of mysql query in an array... qurey in array: "select distinct(EMPLID)from tblwork where EMPLID not in (select... store the result in array
array
array  wap to calculate reverse of 10 elements in an array?  ...(); } System.out.print("Array is: "); for(int i=0;i<arr.length;i...(); System.out.print("After reversing, Array is: "); for(int i=arr.length-1;i>=0
Array's
Array's  I have to finish an "order page". that checks 2 dropdown boxes and a set of radio buttons and put the results into a set of textboxes, 1 line at a time, then calculate a total. I know I need to create an array, but I'm

Ads