Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the 3 types of loops in java?

1087


What is Java Package and which package is imported by default?

1098


What are access specifiers available in java?

1009


Write a method that will remove given character from the string?

1032


What is a singleton class? Give a practical example of its usage.

1105


How to use arraylist in java netbeans?

1046


What is use of valueof () in java?

1054


Why can't we override private static methods?

977


What are keywords in java?

1010


Can an unreferenced object be referenced again?

1193


What is bufferedwriter?

973


Define inheritance?

1021


What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?

984


What is the difference in between cpp and java? Can u explain in detail?

1092


Describe the various concepts related to object oriented programming (oop).

1030