Thursday, 19 January 2023

Write a java program to display following pattern:Write a java program to accept list of file names through command line. Delete the files having extension .txt. Display name, location and size of remaining files.

 

Slip5

Write a java program to display following pattern:

5

4 5

3 4 5

2 3 4 5

1 2 3 4 5

 

 import java.io.*;

public class Pattern

{

  public static void main(String[] args){

   for (int i = 1; i <= 5; i++) {

    for (int j = 5; j >= i; j--)

 {

System.out.print(j + " ");

            }

            System.out.println();

        }

    }

}

 

Write a java program to accept list of file names through command line. Delete the files having extension .txt. Display name, location and size of remaining files.

https://bcapractical2017.blogspot.com/2017/11/corejava-slip12.html