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

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

Is This Answer Correct ?    15 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by ternary operator in java?

975


What is the difference between jdk and jre?

1017


What does += mean in java?

1031


How do you use find and replace?

918


Difference between final and effectively final ?

1041


Explain about narrowing conversion in java?

975


Can we override private method in java?

1061


What is the function of compareto in java?

1024


What are the two categories of data types in the java programming language?

943


What is charat java?

917


What if static is removed from main method?

1033


What is the difference between public, private, protected, and friend access?

1010


Define a package.

1026


Give a brief description of java socket programming?

925


What modifiers are allowed for methods in an interface?

1114