Home Answers Viewqa Java-Beginners Using Nested loops

 
 


Sushmita
Using Nested loops
1 Answer(s)      a year and 3 months ago
Posted in : Java Beginners

How to use nested loops in java when I want to print the 10 multiples of numbers 2 to 15(in multiplication table)

View Answers

February 16, 2012 at 4:44 PM


public class MultiplicationTable{
public static void main(String[] args) {
int[][] array = new int[16][16];
for (int i=1; i<array.length; i++) {
for (int j=1; j<array[i].length; j++) {
array[i][j] = i*j;
System.out.print(" " + array[i][j]);
}
System.out.println("");
}
}
}









Related Pages:
nested for loops
nested for loops  Hello all, I have created a program(gui.... This is my first time using java and my first time programming, but I am guessing that the problem lies with my nested for loop which calculates all information
Using Nested loops
Using Nested loops  How to use nested loops in java when I want to print the 10 multiples of numbers 2 to 15(in multiplication table)   public class MultiplicationTable{ public static void main(String[] args) { int
Loops
Loops  by using drjava q1.Write code that uses nested loops to print the following patterns: Pattern1: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 Pattern 2: 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 q2.Write code
nested loops
nested loops  please tell input to get the output: 12345 23456 34567 45678
I need to output number diamond using nested for loops.
I need to output number diamond using nested for loops.  How to i output this using nested for loops 1 131 13531 1357531 135797531 1357531 13531 131 1
Loops
Loops  Write code that uses nested loops to print the following patterns: Pattern1: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 Pattern 2: 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
Loops
Loops  Write code that uses nested loops to print the following patterns: Pattern1: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 6 Pattern 2: 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
pattern-using loops
pattern-using loops  Write a program that displays the following pattern ... (use nested loops) * ** * ** * ** *   the correct pattren
Loops
Loops  ï??Using for loops, Write a program to simulate a clock countdown. The program prompts the user to enter the number of seconds, displays a message at every second, and terminates when the time expires. Use method
loops
loops  how to use for loop and while loop in java?/ how to write a code using for or while loop
Loops
3.10. Loops Loops are the essential part of the program that have.... More than one loops can be used several times in a script. Loops makes easy... instructed for repetition of the code. PHP Loops In PHP, like other programming
read string - using loops in Java
read string - using loops in Java  Write a program to read a string composed of an unknown number of words, then count the number of words in the string, and Display the longest and shortest words, with first letter Uppercase
Nested If Statement
. Here we are providing you an example using Nested-If statement. In the example, we... Nested If Statement       In this section you will study about the Nested-if Statement in jsp
Solve using only Javascript loops...
Solve using only Javascript loops...  Write a JavaScript code, 1) to find a number of unique letters in string. (Eg. if keyword is unique, Unique count will be '4') 2) so that numbers appear in following format, 1 1 2
print 100 numbers using loops
print 100 numbers using loops  how to print from 1 to 100 using for loop ?   Hi Friend, You can use the following code: class Loop{ public static void main(String[] args){ for(int i=1;i<=100;i
print rectangle triangle with ?*? using loops
print rectangle triangle with ?*? using loops   * * * * * * i want print like this.what is the code?   import java.lang.*; class Traingles { public static void main(String args[]) { for(int i=1;i<=5
For Loops
For loop is used to run the code in the block in the specified number of times. It is pre-directed and can write using parameters.  Syntax for (init; condition; increment)   {   code to be executed;  
Static Nested Classes
Static Nested Classes       A nested class that is declared static is called a static nested class. Memory to the objects of  any static nested classes are allocated
Nested <c:forEach> in JSTL
Nested <c:forEach> in JSTL   ... (JSTL) core library, provides custom tags for basic functionality. Instead of using those hardcoded scriptlet, It allows you to program your pages using tags
Arrays, loops and string handling
Arrays, loops and string handling  How would i go about in creating a program to mark and grade a set of multiple choice test results... correct answers using JOptionPane dialog box and store the entire answer as on string
java loops - Java Beginners
a program to reverse a string using another array and without using another array
java loops - Java Beginners
java loops  Q1-sum the series 2/9-5/13+8/17..... Q2 print first n odd numbers in descending order? Q3 program to input digits and write in words with out using any type of in built function and array program to print truth
print a-z, A-Z with exact order using loops
print a-z, A-Z with exact order using loops  how to print from a-z, A-Z with exact order using for loop? Thanks for all concern
Java repeat string without using loops
Java repeat string without using loops In this section, you will learn how to repeat string without using for loops. The given example accepts the number... using while loop or any other control statements. Example: import
Java reverse words in a string using only loops
Java reverse words in a string using only loops In this tutorial, you will learn how to reverse words in a string without using any inbuilt methods like split() etc, StringTokenizer functiom or any extra ordinary function Only loops
write program have product - using loops
write program have product - using loops  Write a program for a grocery that reads products data and determine and display the product that has the highest price and the average price. A product has three pieces of data: id (int
Java Nested Class
structure shows the way of using the nested class.   class... Java Nested Class        ... class then such a class is called a nested class. Nested classes are a feature
nested selected tag ihave display selected item
nested selected tag ihave display selected item   i have two combo boxes combo1 combo1 in first combo box i taken as follows select name="combo1..." , but i want "INDIA", and i use if condition for each value and display by using
Selection Sort
nested loops. Simple selection sort The basic idea is to look at each
Nested class
Nested class  What is nested class?  when a class is defined within another class then such a class is called a nested class. Nested... nested classes are: It is a way of logically grouping classes that are only used
Loops - Introduction
will introduce you with the Loops in Java. Loops are very useful in programming... Many loops consist of three operations surrounding the body: (1) initialization.... Always using braces allows the reader to relax and not worry about the special
Nested try
Nested try  Hi, In eclipse without providing input i am getting different outputs ie my exception gets executed first then finally block and vice versa.pl explain me class Demo { static void nestedTry(String args[]) { try
nested for-loop
nested for-loop  hi.write a program that will prompt the user for a positive integer(num) and then display two triangles with num number of lines to represent the following patterns of asterisks. the input num must be validated
Nested try
Nested try  Each time when i execute this code in eclipse i get different answers pl help me with this code class Demo { static void nestedTry..., visit the following link: Nested Try Example
program to create nested tables
program to create nested tables  program to create nested tables
Nested classes: Examples and tutorials
Nested classes: Examples and tutorials       Nested classes Here is another advantage of the Java... within another class, such class is called a nested class. Inner classes can
The nested class - Java Beginners
The nested class  Hi, What is nested class in Java? What is the benefits of nested class? Write examples of nested class. Thanks   .../java/n/java-nested-class.shtml Thanks
Java Break Lable
for terminating nested loops. Nested loops are loops defined inside other loops in which  ...; } System.out.println("\nValue at which the nested loops defined under
use of loops and screenshots
use of loops and screenshots  1.how to use loops in netbeans? 2.how to draw a correct screenshot
GROUP BY IN NESTED QUERY
GROUP BY IN NESTED QUERY  Hello Every One, Query to use GROUP BY CLAUSE IN NESTED QUERY SELECT STATEMENT in mysql database.If u know please help me.thanks
Java nested class example
Java nested class example  Give me any example of Nested Class.   Nested Class: Class defined within another class is called nested class. Nested class is divided into two parts- 1.Static 2.Non-static Static
Need help with nested queries
Need help with nested queries  Hello, Table1 has "id", "votes" columns. Table2 has "id", "Name" column. I need to retrieve Name and its corresponging Votes. I tried with nested queries but its confusing. Can anyone please help
Nested and Inner classes
Nested and Inner classes  What is the significance of Inner Classes and Static Inner Classes? or Why are nested classes used?   Hi Friend... a nested class. Inner class is a non static class declared inside another class.Non
Use javascript loops..
Use javascript loops..  Write a Javascript code to create a redirection script based on day of the week

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.