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

Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

1244


How many types of equations are there?

1020


What are extraneous variables examples?

1103


Java Compiler is stored in JDK, JRE or JVM?

1522


What is e in java?

967


How do you remove duplicates in java?

1025


What is a protected void?

932


What exactly is a .class file?

1049


What is anti pattern in cyber security?

1035


Which collections are thread safe in java?

928


Define "Access specifiers" in java.

1174


What is java virtual machine and how it is considered in context of java’s platform independent feature?

1175


What is java objectoutputstream?

991


What is the use of conditional statement?

986


Why is multithreading important?

949