Skip to content

vishwapriya/Diamond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Diamond

package com.company;

import java.util.Scanner;

public class Diamond { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int i,j,k; for(i=1;i<=n;i++) { for(j=i;j<=n;j++) { System.out.print(" "); } for(j=1;j<=(2i-1);j++) { System.out.print(""); } System.out.println(); } for(k=n-1;k>=0;k--) { for(j=k;j<=n;j++) { System.out.print(" "); } for(j=(2k-1);j>=1;j--) { System.out.print(""); } System.out.println(); } } }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published