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 ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you invoke a method?

1010


Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?

991


What is import java util arraylist?

1185


Is java a digit method?

1006


Does set allows null in java?

966


What is the byte range?

1039


What is difference between adapter class and listener?

1049


How can you write a loop indefinitely in java programming?

1037


Explain runtime exceptions?

1184


What is a java list?

1123


What are the six ways to use this keyword?

1061


What do you understand by the term wrapper classes?

1009


Which class is used by server applications to obtain a port and listen for client requests?

967


What is remote method invocation (rmi)?

1072


Can you pass by reference in java?

985