> Write a program to print following pattern:
Solution:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z | |
Z Y | |
Z Y X | |
Z Y X W | |
Z Y X W V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class pattern | |
{ | |
public static void main(String ar[]) | |
{ | |
Scanner scan = new Scanner(System.in); | |
System.out.println("Enter the limit or number of lines"); | |
int limit = scan.nextInt(); | |
int value = 90; | |
int space = limit-1; | |
for(int i=1; i<=limit; i++){ | |
for(int k=space; k>=1; k--){ | |
System.out.print(" "); | |
} | |
for(int j=1; j<=i; j++){ | |
System.out.print((char)value+" "); | |
value--; | |
} | |
System.out.println(); | |
space--; | |
value=90; | |
} | |
} | |
} |
java computer programming samples
ReplyDeleteCanvas (Tab Capturing Canvas)
Hi, thanks for your blog, if you want to learn about programming languages like java, php, android app, embedded system etc. I think this training institute is the best one.
ReplyDeleteBest java training in coimbatore
Android training in coimbatore
Networking training in coimbatore
Grab the astounding Azure Training in Chennai along with the best DevOps Training and Java training from Infycle Technologies, the best software training institute in Chennai. Call 7504633633 to get the best placement guidance along with the software training for having a lucrative career in the software industry
ReplyDelete