Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how to write a program in java to print numbers in equalateral triangle
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pandiyan
how to write a program in java to print numbers in equalateral triangle
1 Answer(s)      2 years and 4 months ago
Posted in : Java Beginners


the output must be
1
324
76589


Advertisement
View Answers

June 21, 2012 at 5:30 PM


Here is an example of pattern

1 
2 3 4 
5 6 7 8 9

Example:

public class NumberTriangle{
    public static void main(String args[]){
        int n=1;
        for(int i=1;i<=5;i=i+2){
            for(int j=1;j<=i;j++){
            System.out.print(n);

            n=n+1;
            }
            System.out.println();
        }
    }
}


Related Tutorials/Questions & Answers:
how to write a program in java to print numbers in equalateral triangle
how to write a program in java to print numbers in equalateral triangle  the output must be 1 324 76589   Here is an example of pattern 1 2 3 4 5 6 7 8 9 Example: public class NumberTriangle{ public
How to print a equilateral triangle patren with numbers
How to print a equilateral triangle patren with numbers  I figure out how to use for loop to print the triangle but i couldn't get the exact values as this http://im37.gulfup.com/FzrOb.jpg could you please help me
Advertisements
Java Program Floyd's Triangle
Java Program Floyd's Triangle In this section you will read about how to write a Java program to print Floyd's triangle. This tutorial is about... for creating the Floyd's triangle in Java. Before writing a Java program
A Program To Print A Equilateral Triangle
A Program To Print A Equilateral Triangle  Write A program to Print Following In Java : 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
write a program to print
write a program to print   write a program to print following 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
C Program to Print Pascal Triangle - Development process
C Program to Print Pascal Triangle  I want C Program to Print Pascal Triangle.  Hi Friend, Try the following code: #include #include void main(){ int a[15][15],i,j,rows,num=25,k; printf("\n enter
Write a program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
Write a program to construct a triangle with the ?*?
Write a program to construct a triangle... '*'. First of all make a class named 'triangle' under the Java I/O package... of times we have to print *.  Now compile and run the program and insert
write an application that print out the even numbers between the range 100-200
write an application that print out the even numbers between the range 100-200   write an application that print out the even numbers between... and determine the even numbers between them. class EvenNumbers { public static
Triangle program
the code 4 this program in java    1 121 12321 1234321 write a program for this triangle    1 121 12321 1234321 write a program for this triangle    1 121 12321 1234321 write a program
how to write this program? - Java Beginners
how to write this program?  (game:scissor,rock ,paper) A program that plays the sciccor-rock-paper game.Revise the program to let the user continuously play until either the user or the computer wins more than 4 times
write a program in C to print following triangles on the screen
write a program in C to print following triangles on the screen  write a program in C to print following triangles on the screen
write a program to use for loop print **********========== in c language
write a program to use for loop print **********========== in c language  write a program to use for loop print **========== in c language
how to write the program - Java Beginners
how to write the program  WAP to create the report card user input Name, Class, Division, Roll no., Marks obtained in following subjects Lang Hindi History Geography Math Phy Chem. Bio Eve CSTA Also has a back up
write a java program to print marklist of n students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c
Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c  class rose { int n...); System.out.println("\nReverse the number"+i); S.out(); } }   print
Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers
Java write even numbers to file
Java write even numbers to file In this section, you will learn how to write the even numbers to file. By using the PrintWriter class, you can write any type... have used print() method to store the even numbers to the file. println
Write a program to list all even numbers between two numbers
Write a program to list all even numbers between two numbers       Java Even Numbers - Even Numbers Example in Java: Here you will learn to write a program for listing out
write a java program
write a java program  write a program to print '*' in a circular form
how to add to numbers in java
how to add to numbers in java  how to add to numbers in java
print numbers
print numbers  1234 123 12 1234   1234 123 12 1234
how to perform a equqlity triangle in java
how to perform a equqlity triangle in java  below the output 1 2 3 4 6 5 7 9 10 8
how do i write a java program for this??
how do i write a java program for this??  ‚??Ask the user if they have a dog. If ‚??yes‚??, ask the user how old is and compute the dog‚??s age... in your program
Java program - convert words into numbers?
Java program - convert words into numbers?   convert words into numbers?   had no answer sir
Triangle Program
Triangle Program  i want program code for 1 2 3 4 5 6 7 8 9 10 any body please help me   public class Triangle { public static void main(String[] args
How to Write a Calculator Program in Java?
How to Write a Calculator Program in Java? In this Java Tutorial you will learn how to write a Calculator program in Java in easy steps. Calculator program..., subtraction, multiplication or division. In this example of writing program in Java
Write a program in java...
Write a program in java...  Hi, friends Please, can you help me? Q1: Write a program in java to simulate a calculator. Your program should take two... to enter an integer number. Write a program in java to find the factorial
how to perform a equqlity triangle in java
how to perform a equqlity triangle in java  below the output 1 2 3 4 6 5 7 9 10 8   Here is an example of pattern like 1 2 3 4 5 6 7 8 9 10 Example : public class NumberTriangleClass{ public static void
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.
PLEASE Help me write a Java program which will store, manipulate, and print..., ADDRESS AND ADMISSIONS CLASS PLEASE HELP!!! Write a Java program which will store, manipulate, and print student registration information. As part
Advertisements
 

 

 

DMCA.com