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 / subash chandra bose l

class Tri
{
public static void main(String args[])
{
int i,j,k,sp=30;
for(i=1;i<=5;i++)
{
for(k=0;k<sp;k++)
{
System.out.println(" ");
}
sp=sp-2;
for(j=1;j<=i;j++)
{
System.out.println(" "+j);
}
}
}
}
this will print up to 5 rows and if u want more rows to be
printed you can increase the i<=n where n may be the number
of rows you want to print.

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use predicate in java?

998


Explain the available thread states in a high-level?

909


What is static data type in java?

974


What is your platform’s default character encoding?

1016


What is the parse method in java?

1050


Is object a data type in java?

1048


how to know the total memory occupied by the objects in the ArrayList(Array list may contain duplicate objects)

2282


When will we use them?

977


Is stringwriter thread safe?

939


What does java se mean?

965


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

955


Can we extend singleton class in java?

912


Can you make a constructor final?

978


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1043


Why inputstreamreader is used in java?

958