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



Home Answers Viewqa Java-Beginners print the sequence
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Tina Smith
print the sequence
3 Answer(s)      2 years and 3 months ago
Posted in : Java Beginners


how can I write the code by using for loop to produce this following statement: 10,9,8,7,6,5,4,3,2,1,buzz!

please, help me


Advertisement
View Answers

July 29, 2012 at 5:07 PM


class loop { void main() { for (int i = 10; i>=1; i--) { System.out.print(" "+i+","); } System.out.println("buzz!"); } }



July 30, 2012 at 11:37 AM


Here is a code that displays the required sequence: 10,9,8,7,6,5,4,3,2,1,buzz!

class ForLoop {
    public static void main(String args[]) {
        for (int i = 10; i>=1; i--) {
            System.out.print(i+",");
            } 
            System.out.println("buzz!");
            }
        }


July 30, 2012 at 5:02 PM


thank you so much



Related Tutorials/Questions & Answers:
print the sequence
print the sequence  how can I write the code by using for loop to produce this following statement: 10,9,8,7,6,5,4,3,2,1,buzz! please, help me
Processing Sequence of DispatcherServlet
In this section, you will get to know about the processing sequence of DispatcherServlet
Advertisements
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
Print
into the stream and, as opposed to print() method, gets you to the new line after the text
HIbernate call for sequence - Hibernate
HIbernate call for sequence  I have created a sequence in oracle table. Now how to access this in java class through hibernate from dual table i am... the sequence using dual table. Thanks in advance
Sequence generator problem - JDBC
Sequence generator problem  Dear sir, I have created one table by name massemailsendingdetails. CREATE TABLE MASSEMAILDETAILS( ID...) ); Then i created a sequence generator for an id as follows CREATE SEQUENCE
DNA sequence - Java Beginners
DNA sequence  Write a java program to read a file that contains DNA sequences of arbitrary length one per line (note that each DNA sequence is just a String). Your program should sort the sequences in descending order
print the newline
print the newline  Why doesn?t the following code print the newline....?; print $str; ?>   Hi friends, Inside the single quotes \n (newline) is not worked as new line, just as a sequence of two characters - \ and n
Wraps a character sequence into a buffer.
Wraps a character sequence into a buffer. In this tutorial you will see how to wraps a character sequence into a buffer. Here in this example a string variable is having a sequence of character which is further wrapped into a buffer
Define sequence generated primary key in hibernate
Define sequence generated primary key in hibernate  How to define sequence generated primary key in hibernate?   Use value "sequence...="java.lang.Long"> <generator class="sequence"> <param name
Sequence number to generate daily starting with 1
Sequence number to generate daily starting with 1  Sir, I am creating a bill report Application..I want to generate a sequence number for bill that is starting from 1.and if date changes the sequence number again starts with 1
Counting the highest sequence of zeros and one's - Java Beginners
Counting the highest sequence of zeros and one's  Count the highest sequence value of '0's and '1's. for a given string with zeroes and ones. Input: You should ask user to enter any bit string with zeros and ones sequence
MX Sequence Effect in Flex4
MX Sequence Effect in Flex4: The Sequence effect is used to play multiple effects one after the other according they are added. The tag of Sequence Effect is <mx:Sequence>. In this example you can see how we can use Sequence
Tab sequence problem with Radio buttons - JSP-Servlet
Tab sequence problem with Radio buttons  Hi, I have membership... button) courier delivery courier(radio button) currently tab sequence going from 1 year radiobutton to courier button but tab sequence has to go as from 1
how to use sequence as a generator class in hibernate for ms sql
how to use sequence as a generator class in hibernate for ms sql  Hi deepak, I have following requirement, I have to use sequence as a generator class for ms sql database. Do we need to create an sequence in mssql prior
print a form of *
print a form of *   * *** ***** ******* ********* ******* ***** *** *   Post the format properly
Read a string and reverse it and then print in alphabetical order.
Read a string and reverse it and then print in alphabetical order... is a contiguous sequence of symbols or values, such as a character string (a sequence of characters) or a binary digit string (a sequence of binary values). In the example
print numbers
print numbers  1234 123 12 1234   1234 123 12 1234
Print the document
Print the document  I tried to print web page.I am using the below...() { var printWindow = window.open('test', 'Print Window', 'height=600,width...;Print Window</title>'); printWindow.document.write('</head>
Print the document
Print the document  I tried to print web page.I am using the below...() { var printWindow = window.open('test', 'Print Window', 'height=600,width...;Print Window</title>'); printWindow.document.write('</head>
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
Print a statement
Print a statement  hello what would we output for this statement System.out.println ("5"+"A" + 3);   hello output will be 5A3
diamond print
diamond print   print the pattern 1 2 3 4 5 6 7 8 9 10 11 12
print initials
print initials  How to print initials of a name without using arrays?   Hi Friend, You can try the following code: import java.util.*; public class InitialName { public static void main(String[] args
Print command
Print command  Can I use System.out.println command in Struts form bean or Struts action class. I am using Struts 1.3.8 but when I write this command. It does not work. Please reply me as soon as possible. Thanks.   
To print initials
To print initials  import java.util.Scanner; class initials { String a ; int e ; char f ; int b ; int c ; char d; Scanner sc = new Scanner(System.in); void main
should print in console
should print in console  
print form information when click on print button
print form information when click on print button   Sir,I desingn institute webside using jsp and strut by using platform netbean 7.2.So request you please help for printing form information by clickin print button after submit
print square of any number
print square of any number  using c++ language, write aprogram to print the square of any number entered by the user
how to print the server time
how to print the server time  how to print the server time in jsp and update time in fix interval
 

 

 

DMCA.com