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
What is bool mean?
Explain the difference between extends thread vs implements runnable in java?
Which object oriented concept is achieved by using overloading and overriding?
Difference between nested and inner classes ?
Explain serialization and deserialization in java?
What is a numeric format?
How do you override a method in java?
How do you pass by reference?
Can java inner class be static?
Is there any difference between nested classes and inner classes?
What is e java?
What are extraneous variables examples?
What is the difference between a field variable and a local variable?
What is logical variable?
Where is core java used?