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 / ravi jain

public class Test
{
public static void main(String[] args)
{
int sp=5;
for(int n=1;n<=5;n++)
{
for(int s=1;s<=sp;s++)
{
System.out.print(" ");
}
for(int i=1; i<=n;i++)
{
System.out.print(i+" ");
}
System.out.println();
sp--;
}
}
}

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is final int?

946


How to sort an array from smallest to largest java?

941


What are the three parts of a lambda expression?

944


Is namespace same as package in java?

934


Can we assign the reference to this variable?

921


Difference between ‘is-a’ and ‘has-a’ relationship in java?

943


What is string pool?

1021


Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?

1096


What is an object's lock and which object's have locks in java programming?

994


Is java based on c?

934


What is a war file?

1006


Why java is platform independent? Explain.

956


What is append function?

939


What about interthread communication and how it takes place in java?

990


What is use of arraylist in java?

1097