Computer Science, asked by bidisha19, 10 months ago

do the following pattern in BLUE J
hint is given...i will mark brainliest..​

Attachments:

Answers

Answered by Anonymous
8

CODE :

class pattern

{

public static void main(String args[])

{

int v=1;

for(int i=1;i<=5;i++)

{

for(int j=1;j<i;j++)

{

System.out.print(" ");

}

for(int k=5;k>=i;k--)

{

System.out.print(v++%10);

}

System.out.println();

}

}

}

OUTPUT :

12345

6789

   012

     34

       5

//Why did you have to write that hint ? xD


bidisha19: my whim
bidisha19: by the way it is not coming...wrong input
Anonymous: Can I show you the output ? I have complied this and my compiler in BlueJ cannot be wrong even if I am wrong .
bidisha19: ok baba ...ur right ...now rest in peace
Anonymous: xD I am not dead .
bidisha19: i think u may
Answered by bbbb67
1

Program:

class Solution

{

public static void main(String args[])

{

int v=1;

for(int i=1;i<=5;i++)

{

for(int j=1;j<i;j++)

{

System.out.print(" ");

}

for(int k=5;k>=i;k--)

{

System.out.print(v++%10);

}

System.out.println();

}

}

}.

This program has been successfully compiled in BlueJ.

Similar questions