Tell me the programme for this


@
1 2
@ @ @
1 2 3 4

Answer Posted / varun

public class HelloWorld{

public static void main(String []args){
int k=1;
for(int i=0;i<4;i++)
{
for(int j=0;j<=i;j++)
{
if(i%2==0)
System.out.print("@");
else
System.out.print(++k);
}
System.out.println();
k=0;
}
}
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many digits can a float hold?

541


Can each java object keep track of all the threads that want to exclusively access it?

544


How do you remove an element from an arraylist in java?

464


What is the purpose of abstract class?

531


Is cout buffered?

691






Is ruby built on java?

537


What is byte value?

561


What is slash r?

548


how to split string in java?

660


Why is it important to initialize a variable?

502


Can java program run without jre?

575


What type of variable is gender?

552


Which is bigger float or double java?

528


Is singleton class immutable?

542


Is arraylist ordered in java?

582