Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Hina Saeed
Modified shap
1 Answer(s)      6 years and 5 months ago
Posted in : Java Beginners


Respected Sir, Now i need of diamond shap with outline of diamond shape.Using single" " and "*" with looping structure.Please help me!


Advertisement
View Answers

April 10, 2008 at 7:24 PM


Hi Friend

import java.io.*;
import java.io.BufferedReader;

public class PrintDiamond{
public static final void main(String[] args) throws IOException{
BufferedReader read = new BufferedReader( new InputStreamReader(System.in));
System.out.print("Enter the numerical Numebr:");
String str= read.readLine();
int n = Integer.parseInt(str);
for ( int i = 1; i <= n; i += 2 ){
for(int k = 0; k < ( n - i ); k += 2)
System.out.print(" ");
for(int j = 0; j < (( i * 2 ) - 1 ); j += 2)
System.out.print(" *");
System.out.println(" ");
}
for(int i = 1; i <= n; i += 2){
for(int k = 1; k < i; k += 2)
System.out.print(" ");
for(int j = 0; j <= (n - i); j++)
System.out.print(" *");
System.out.println(" ");
}
}
}



Related Tutorials/Questions & Answers:
Modified shap - Java Beginners
Modified shap  Respected Sir, Now i need of diamond shap with outline of diamond shape.Using single" " and "*" with looping structure.Please help me!  Hi Friend import java.io.*;import java.io.BufferedReader;public
Last modified date of a folder
Last modified date of a folder  How to get the last modified date of a folder specified by a link in html
Advertisements
Last modified time of a webpage
Last modified time of a webpage  how can we get the last modified time of a webpage using java
Resources have been modified iPhone
Resources have been modified iPhone  Hi, My client is getting Resources have been modified error while installing AdHoc distribution on his iPhone. How to solve Resources have been modified iPhone error? Thanks   Hi
To Display the 'Last Modified' message in JSP
To Display the 'Last Modified' message in JSP  I have to display the "Last Modified" auto save message in a portlet page at the right end corner... Modified' Message should be displayed
how to find which user has modified the file
how to find which user has modified the file  how to find which user has modified the file
Sort last modified file time in java
Sort last modified file time in java  How to sort the last modified file time in java?   import java.io.*; import java.util.*; import java.text.*; public class FileModifiedDate { public static void main(String
C file Last Modified Date
C file Last Modified Date       This section demonstrates you to find the last modified date... modified date of the specified file Hello.txt. For this, we have defined
Find the date of the file before the file has been modified
modified?   hi friend, you can get the date of last modified file using... last modified date of a file you may go through the following link may
Find the files that has been modified before run the program
Find the files that has been modified before run the program  Hi. I have a code that can find the latest modified file in the directory...; } } }); //get the file name that has latest modified date
Find the files that has been modified before run the program
Find the files that has been modified before run the program  Hi. I have a code that can find the latest modified file in the directory. //store...; } } }); //get the file name that has latest modified date files = ((File
Find the files that has been modified before run the program
Find the files that has been modified before run the program  Hi. I have a code that can find the latest modified file in the directory. //store...; } } }); //get the file name that has latest modified date files = ((File
The app was not installed on iphone because its resources have been modified
resources have been modified" What is the solution? Thanks   Hi, You have
Java file modified date
Java file modified date In this section, you will learn how to find the modification date and time of the file. Description of code: We have created an instance of File class and specify the file. Then, we have checked whether
Java file last modified date
Java file last modified date In this section, you will learn how to get... it. You can use the lastModified() method to get the file?s last modified...("The file was last modified on: " + dateString); } } Through the method
Java latest file
Java latest file In this section, you will learn how to find the file which is generated or modified at last. Description of code: To find the last modified file, we have used the Comparator interface that compare the files 
Java read latest file
Java read latest file Java provides IO package to perform file operations. Here we are going to read the last modified file. For this, we have used the Comparator interface that compare the files and by using the Arrays.sort() method, we
PHP variables
PHP Variable Index A variable is like a container which stores a value which can be modified further, in each computer language programming variables plays a vital role and in each language the declaration of it varies. Unlike a constant
URL Rewriting in Java
is modified to include extra information. Since for URL rewriting, provided space
date_isodate_setdate
date_isodate_setdate The ISO Date Format PHP or DateTime::setISODate function sets the date according to ISO 8601 standard - using weeks and day offsets rather than specific dates. It returns the modified DateTime.  Description
date_time_set
date_time_set date_time_set alias DateTime::setTime function resets the the current time of the DateTime object to a different time. It returns the modified date and time.  Syntax public DateTime DateTime::setTime ( int
Discovery Machine Gear
usable, executable graphical software that can then be shared, modified
Hibernate Synchronizer
will automatically generate java code when your hibernate mapping files are modified... will be modified. How do I install this plugin? There are two different update sites
date_timezone_set
date_timezone_set() in PHP date_timezone_set alias DateTime::setTimezone function is used for setting the time zone for the DateTime object. It returns the modified DateTime.  Syntax on date_timezone_set() PHP public
Alvicom JavaCov
Alvicom JavaCov       JavaCov is a unique J2SE/J2EE coverage-testing tool. It is the only Java testing tool capable of verifying the so-called MC/DC (Modified
java program:scrollbar
java program:scrollbar  my program logic is that when i scrolling scrollbar according to that the oval shap is changed by fetching the value of scrollbar the oval is drawn please give me a proper code of this logic
java prog
java prog  write a java program to accept a file name as command line argument.Append the string "file modified by program" to the end of the same file and print the contents of the modified file
java IO
java IO  Write a Java program to accept a file name as command line argument. Append the string "File Modified by Programme" to the end of the same file and print the contents of the modified File
Java
Java  with out changing the src can i modified the code in dot class file in JAVA is it possible are not .Please send me as early as Possible
Dirty page and Dirty report
report?   hello, Dirty Pages: Data that which is modified and Stored... by Second Transaction which was modified by First Transaction and First Transaction... then Second Transaction has read data that never was modified or exists
how to create ipa file
how to create ipa file  Hi, How to .ipa file? Thanks   Hi, Please check the thread Resources have been modified iPhone. Thanks
basic
basic  thank you sir for your nice reply . ......sir my next que, if java program is modified,if the program is compiled & executed without saving it again,its previous execution takes place,why
final
final  what does final means in "public static final void main (string args[])" ?   keyword final can be assigned only once. They cannot be modified
filling oval color in excel using jsp
of the shap. In this example we are creating the sheet and an oval and at last we fill
Java - Java Beginners
constant which cannot be modified after Instantiation. If it is applied...://www.roseindia.net/java/javascript-array/modified-java-method-final
JTable - Swing AWT
to modifying multiple cell values in a row. also i want to store those modified values into the dbtable and want to generate the log of that modified entries
Java file canWrite()
. Description of code: This method tests whether the file can be modified... whether we can modified the file content or not. This method returns boolean value...  tests whether the file can be modified. Here is the code: import
date_timestamp_set
It returns the modified DateTime
configuration files - Java Beginners
configuration files  i have to use configuration file in my program "listing of number of files and their modified time of directory",but problem is that directory name should be provided through configuratin file not input
java
the compiler that the variable modified by volatile can be changed unexpectedly
Change a file timestamp
modified date in 'dd-mm-yyyy' format: 23-04-2007 Modification
Java
Java  Why C++ is not purely object Oriented?   Hi Friend, In C++, a class is completely defined by a syntactic construct and once it is defined, it cannot be modified in runtime. That's why C++ is not a purely object
getting files from VSS
to executing "vsspath="$\FunctionalAuto\ExcelBased" filetimestamp="modified"/>
Session Modification
Session Modification in PHP Session modification can be done through incrementing the loop. As the counting of loop increments, the session be modified. ...; The Output: The output will be modified session
core java - Java Beginners
and Overriding: http://www.roseindia.net/java/javascript-array/modified-java-method-overloading.shtml http://www.roseindia.net/java/javascript-array/modified-java
Tiger XSLT Mapper
interface. While the mappings and XML structures are modified, the XSLT template is automatically generated and modified. Tiger XSLT Mapper has been created
Mysql Alter Tables
table by adding column modified. Query ALTER TABLE example ADD COLUMN modified TIMESTAMP..._author | t_count | modified
MySQL Blank Field
_author | t_count | modified | userid... +----------+---------+---------------------+--------+ | t_author | t_count | modified...; +----------+---------+---------------------+--------+ | t_author | t_count | modified | userid
java - Java Beginners
://www.roseindia.net/java/javascript-array/modified-java-method-overriding.shtml http...-array/modified-java-method-final-parameter.shtml Hope
 

 

 

DMCA.com