Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java program to print the character or a letter x using star

import java.util.*;class Main{public static void main(String args[]){ int i,j,n;Scanner sc = new Scanner(System.in);System.out.println("Enter the number to print the character");n = sc.nextInt();for(i=n;i>=1;i--){for(j=i;j<n;j++){System.out.print(" ");}for(j=1;j<=(2*i-1);j++){if(j==1 || j==(2*i-1))System.out.print("*");elseSystem.out.print(" ");}System.out.println("");} for(i=2;i<=n;i++){for(j=i;j<n;j++){System.out.print(" ");}for(j=1;j<=(2*i-1);j++){if(j==1 || j==(2*i-1))System.out.print("*");elseSystem.out.print(" ");}System.out.println("");} }}
Comment

PREVIOUS NEXT
Code Example
Java :: java transformar string a url 
Java :: android java how to show progressdialog in fragment 
Java :: spring boot initializr-generator example 
Java :: pvector maximum dimension 
Java :: Execute method on load alternative 
Java :: java cambiar formato de fecha 
Java :: restore 
Java :: coin flip random java 
Java :: search in row and column sorted matrix leetcode 
Java :: Java program to print Student Info by using Class, Object, Method. 
Java :: var keyword not working in spring boot application 
Java :: java stream list order lambda 
Java :: java Least prime factor of numbers till n 
Java :: Picked up _JAVA_OPTIONS: -Xmx256M intillij 
Java :: PlatformException (PlatformException(unknown, java.lang.Exception: Client is offline, {code: unknown, message: java.lang.Exception: Client is offline}, null)) 
Java :: SmallChange 
Java :: Creating Hashmap from Treemap 
Java :: .throwFor in java 
Java :: java loop array 
Java :: how to getobject from id in controlp5 
Java :: re-loop after last item in array java 
Java :: youtube converter to mp3 
Java :: how to import a self written class in java 
Java :: min,max functions in java 
Java :: merced A class 
Java :: create and populate list one line java 
Java :: arrays in constructor java 
Java :: set default messaging app android manifest 
Java :: how to clear cli screen 
Java :: best wireless headphoenes under 200 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =