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 largest number a double can hold?
Is alive method in java?
Why isn’t there operator overloading?
what is meant by encapsulation?
Is map ordered in java?
List any five features of java?
What is try-with-resources in java?
Is there any difference between nested classes and inner classes?
What is static in java?
How do you implement singleton class?
Can we extend singleton class?
What is exception handling in java?
What is a class in java?
why not override thread to make a runnable? : Java thread
How will you call an Applet using Java Script Function?