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

Wha is the output from system.out.println(“hello”+null); ?

1222


what is the difference between Object Based Language and Object Oriented Language?

1087


How to declare an arraylist in java?

1194


What occurs when an object is constructed?

1068


What are the differences between heap and stack memory?

1148


how we can make a write-only class in java?

1082


What are the difference between string, string builder, and string buffer in java?

1174


Explain, java is compatible with all servers but not all browsers?

1109


Name few "optional" classes introduced with java 8 ?

1187


What is difference between array and vector?

1140


How is the marker interface used in Java?

1143


What is the maximum size of list in java?

1019


Can we split string with in java?

1075


What is unicode with example?

1313


What is the intersection and union methods?

1080