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

public class pattern
{
public static void main(int n)
{
int i,j,k;
for(i=1;i<=n;i++)
{
for(j=n;j>i;j--)
{
System.out.print(" ");
}
for(k=1;k<=i;k++)
{
System.out.print(+k+" ");
}

System.out.println();
}
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are arrays passed by reference in java?

921


Difference between final and effectively final ?

1115


What are the rules for naming an array?

1065


What is scope & storage allocation of global and extern variables? Explain with an example

1049


What is mutable object and immutable object?

1137


What is a type parameter in java?

1000


What is singletonlist in java?

974


Can a string be null?

995


What is classname class in java?

1075


If a method is declared as protected, where may the method be accessed in java programming?

1005


What is maximum size of arraylist in java?

1041


Can constructor be synchronized?

946


What is the method to declare member of a class static?

1018


Difference between comparator and comparable in java?

1106


What is private static in java?

1047