Tell me the programme for this
@
1 2
@ @ @
1 2 3 4
Answer Posted / sachin
package abc;
public class Sachin {
int n=4;
public static void main(String... args){
Sachin s=new Sachin();
for (int i=0;i<s.n;i++){
if(i%2==0){
for(int a=0; a<i+1;a++){
System.out.print("@");
}
}else{
for(int a=0; a<i+1;a++){
System.out.print(a+1);
}
}
System.out.println();
}
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can a java program have 2 main methods?
What is the method overriding?
What is ph and buffers?
Which is fastest collection in java?
What are different data structures in java?
what is the difference between Object Based Language and Object Oriented Language?
v-model life cycle
What is string made of?
What is the purpose of static methods and variables?
what are three ways in which a thread can enter the waiting state? : Java thread
What is yield () in java?
What are the common uses of "this" keyword in java ?
Explain the private field modifier?
What do you mean by checked exceptions?
Why are generics used?