Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

floyd triangle in java

import java.util.*;
class floyd
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter number of lines: ");
        int num = sc.nextInt();
        int i, j, k = 0;
        for(i = 1; i <= num; i++)
        {
            for(j = 1; j <= i; j++)
            {
                k++;
                System.out.print(k + " ");
            }
            System.out.println();
        }
        sc.close();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: bukkit runnable 
Java :: l,og in android studio 
Java :: java get monitor size 
Java :: android studio visibility 
Java :: java how to calculate fps 
Java :: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-24.1-jre (com.google.guava:guava:24.1-jre) and jetified-listenablefuture-1.0 (com.google.guava:listenablefuture:1.0) 
Java :: date to string java 
Java :: how to deselect radio button in java 
Java :: java lombok constructor inject guice 
Java :: Spigot API inventory close 
Java :: how to make jframe visible 
Java :: java split first occurrence 
Java :: finally block does not complete normallyJava(536871096) 
Java :: android parse timestamp 
Java :: coding fill method java 
Java :: java string format .2f 
Java :: k combinations for range 1 through n 
Java :: taking date as input in java 
Java :: void get method using collections 
Java :: take string until / 
Java :: Which API provides a lightweight solution for GUI components? 
Java :: youTubeInitializationResult gives SERVICE_MISSING error in android 
Java :: discord failed to install mac 
Java :: get all number from string java 
Java :: localdatetime to timestamp 
Java :: How to perform an iterative depth first search through a binary tree, in Java? 
Java :: java array contains 
Java :: how to get the dimensions of a 2d array in java 
Java :: swing enter key 
Java :: convert hashset to array 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =