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 / yagnik

public static void main(String args[]) throws
UnknownHostException, ClassNotFoundException
{
int count =5;

for(int i=1,h=5; i<count;i++){

for(int k=h;k>=0;k--)
{System.out.print(" ");}
for (int j=1 ;j<=i;j++){
System.out.print
(j);System.out.print(" ");
}
h--;System.out.println();
}

}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is runtime polymorphism or dynamic method dispatch?

1008


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

2339


What are keyboard events?

1152


How do you add an element to an arraylist in java?

946


What is immutable state?

1027


What is keyword and identifier?

1136


What are disadvantages of java?

1000


What is yield () in java?

887


What is the purpose of the main method?

992


What is string builder?

894


Is an integer an object?

968


Can we convert list to set in java?

998


Which containers use a flowlayout as their default layout in java programming?

1014


Can inner class extend any class?

1057


How do generics work in java?

1032