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

Is static variable stored in heap?

924


What is difference between c++ and java ?

1073


How can I become a good programmer?

920


What are the 3 types of loops in java?

987


Can constructor be static or final?

1037


Explain about fail safe iterators in java?

962


What is a function argument in java?

944


extending thread class or implementing runnable interface. Which is better? : Java thread

955


What is a modifier?

1430


How many types of design patterns are there?

1043


What do you mean by JVM?

1010


Is java hashset ordered?

1048


What is wrapper class html?

887


What are the Class Libraries ?

999


What are different types of inner classes ?

986