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...

Program to print 1
1 2
1 2 3
1 2 3 4 like that

Answer Posted / yun hin

class triangle{
public static void main(String args[]){
int height = 5;

for(int i=1;i<=height;i++){
for(int j=1;j<=(height-i);j++){
System.out.print(" ");
}
for(int k=1;k<i;k++){
System.out.print(k + " ");
}
System.out.print(i);
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

Why is method overloading not possible by changing the return type in java?

1054


How static variable work in java?

1192


How can an object be unreferenced?

1071


How to provide security in java

2329


How will you add panel to a frame?

1166


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

1013


Can you declare an interface method static?

1108


What is difference between overloading and overriding in java?

1083


What is polymorphism in java? What are the kinds of polymorphism?

1120


What are the differences between heap and stack memory?

1148


What is the return type of the main method?

1091


What is variable in java?

1047


What is java oops?

1166


What is considered an anti pattern?

985


What is the abstract class?

1095