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
What is the common usage of serialization?
What are the advantages of defining packages in java?
Why is java called java?
What do you mean by inner class in java? Explain
Can we define constructor in inner class?
What is the static field modifier?
What are different types of constants?
What is another word for methodology?
A person says that he compiled a java class successfully without even having a main method in it? Is it possible?
What are the types of literals?
Explain about the security aspect of java?
What is string manipulation?
Which programming language is best in future?
What does a method signature consist of?
What super () does in java?