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 do bitwise operators do?
What is stringjoiner ?
What is the main use of java?
What is OOP's Terms with explanation?
Can list contain null in java?
What happens when a thrown exception is not handled?
Why do we need hashset in java?
What is the importance of main method in Java?
What all access modifiers are allowed for top class ?
What is string :: npos?
What is a substring of a string?
Why main() method is public, static and void in java ?
what is a working thread? : Java thread
What are the principle concepts of oops?
How to compare strings in java?