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 / thati.donthi

public class PrintTriangle {

public static void main(String[] args) {
int n=4;
for(int i=1;i<=n;i++) {
for(int j=0;j<2*n-i;j++) {
System.out.print(" ");
}
for(int j=1;j<=i;j++) {
if(i%2 != 0) {
System.out.print("@"+" ");
} else {
System.out.print(j+" ");
}
}
System.out.println();
}
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In Java list the methods that can be overridden?

951


What is a concrete classes? Is Java object class is concrete class?

939


What is the difference between stored procedure & function?

928


What are the main uses of the super keyword?

922


What is the maximum size of hashmap in java?

942


What is http client in java?

1027


What do you mean by composition in java?

955


Why does java does not support multiple inheritance? Explain

925


What is the difference between multitasking and multithreading in Java

1134


What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?

2435


What is void class in java?

919


Why we use methods in java?

941


what are three ways in which a thread can enter the waiting state? : Java thread

952


What is the program compilation process?

1036


What is r * in math?

938