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 are the advantages of java over C++?
What is JDBC Driver interface?How can you retrieve data from the ResultSet
explain copyonwritearraylist and when do we use copyonwritearraylist?
What is java console application?
What is a finally block? Is there a case when finally will not execute?
What is the exception hierarchy in java?
What is the difference between access specifiers and access modifiers in java? 16
What is the difference between the font and fontmetrics classes in java programming?
How do you add an element to a set in java?
Can you run java program without main method?
What is a priority queue java?
Can we sort array in java?
What is initial size of arraylist in java?
What restrictions are placed on method overriding?
How do you find the independent variable?