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 output as below formate:
1
2 3
4 5 6
7 8 9 10

Answer Posted / dhananjaya nawarathne

public class formatNumbers {
public static void main(String args[])
{
int k=1;
for(int i=1;i<5;i++)
{
for(int j=0;j<i;j++)
{
System.out.print(k++ + " ");
}
System.out.print("
");
}
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which collection is ordered in java?

942


What is pass by value?

903


What is java reflection api?

981


What is an infinite loop? How infinite loop is declared?

1036


What does function identity () do?

927


What ide should I use for java?

977


What does snprintf return?

965


Is 0 a real number?

989


What are the three parts of a lambda expression?

963


How do you represent a space in regex java?

971


What are the benefits of operations in java?

969


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

1055


What is yield () in java?

839


What is boolean query?

931


How does the java compiler work?

930