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

Are arrays classes in java?

533


When arithmeticexception is thrown?

581


What is compareto?

542


What are the string methods in java?

580


What access modifiers can be used for methods?

557






What do you understand by a Static Variable?

630


What is JFC?

707


Is binary a low level language?

503


what r advatages of websphere? & how to deploy?

1636


What is the multi-catch block in java?

531


Explain about collection interface in java?

543


Does .length start 0 java?

565


How to access arraylist elements in java?

488


How many types of parsers are there?

544


How does split work in java?

529