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

How many bits is a boolean?

1094


What is the use of volatile in java?

1059


In Java list the methods that can be overridden?

1017


What happens if an exception is throws from an object's constructor?

1135


What is the difference between C++ and Java and your preferences?

1116


What is valid keyword in java?

1004


How to sort elements in a parallel array in java?

904


What is meant by oops concept in java?

1002


what is deadlock? : Java thread

1015


What is the benefit of inner / nested classes ?

988


What is the replace tool?

1177


Is null function in java?

1054


What is args length in java?

1178


Do I need to import java.lang package any time? Why?

1395


What is a "pure virtual" member function?

1103