Need help to print numbers

CAN SOMEONE HELP ME TO WRITE A JAVA CODE Please
//WHAT I AM TRYING TO DO HERE IS TO PRINT NUMBERS LIKE THIS EXAMPLE:
1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
There is a code to print first line (1 2 3 4 5 6 7 8 9 10)
import becker.util.Utilities;
public class Main
public static void main(String[] args)
{      for (int b = 1; b <= 10; b+=1)
     { System.out.printf(" "+ b);
     Utilities.sleep(30);
Thanks

here you go this should do the trick
import java.*;
import javax.swing.*;
public class Count {
     public static void main(String args [])
          Count c = new Count();
          c.Countpart();
     public void Countpart()
          for(int b=1;b<11;b++)
               System.out.print(b);
          System.out.print("\n");
          for(int d=2;d<22;)
               System.out.print(d);
               d= d+2;
          System.out.print("\n");
          for(int f=3;f<33;)
               System.out.print(f);
               f=f+3;
}hwrd

Similar Messages

  • Need help in converting numbers to Italian text

    Need help in converting numbers to text in Italian language. I want to knw is there any method other than SE63 to translate these text in one shot. I have tried with LSMW also (as the sheet is in XLS format ).Plz reply if anyone is aware of this ..

    hi,
    chk this code.
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    amount = amount
    currency = 'EUR'
    filler = ' '
    language = 'E'  => give the language as italian
    IMPORTING
    in_words = amountrs.
    rgds
    anver
    pls mark all hlpful answers

  • MacBook - Newbie: Need help on printing wirelessly to XP shared printer

    MacBook - Newbie: Need help on printing to XP shared printer
    Bear with me please. I read tons of articles on this but somehow as a newbie to MAC (girlfriends sick daughter), I am missing something. 10.5.2
    Currently, she can print directly if we plug in the HP Deskjet printer directly via USB to the MACBook. No problem.
    When we first got the MACBOOK I tried setting up the MACBOOK wirelessly to recognize the workgroup where the printer was attached via USB to the Windows XP PC. However it printed out garbage since I did not know there was a difference between XP printing and MAC (Gutenberg/gimp printing/drivers).
    Now I know there is a difference.
    But in reading various instructions, I no longer can find how to connect the MAC to the Windows workgroup. Note we do have a printer set up currently as USB-HP Deskjet on the Macbook (not sure I need to delete it yet).
    I went to System Preferences on MACBOOK and clicked on printers, more printers. In the drop down box was CANON, APPLETALK, IP HP printing and Firewire. There was no WINDOWS selection as I saw in other online web instructions.
    So not sure how to proceed to find a way to:
    1. Connect to Windows workgroup (click on what exactly), step by step please!!
    2. Add correct HP Deskjet 5490 printer (perhaps there is one with Gutenberg or perhaps I need Gutenprint-really not sure what I am talking about)
    Thanks so much in advance. Fiancé's kid has had her cancer recur in a different place and someone was nice enough to buy her a MACBOOK as a gift.
    Sincerely
    Peter

    ccarbery wrote:
    OK...I figured it out...no need to reply.  I noticed that there was another Protocol to use to set up the printer on the Mac, I was using LPD, so I switched it to HP Jet Direct-socket, and it prints fine...thanks.  I am curious as to why LPD wouldn't work; if anyone has that answer I would like to know...thanks
    Any chance of posting the Protocol you used to connect to your printer with your laptop?  I'm have the exact same problem printing from my MB.  Same error message "..is busy".

  • I need help with printing labels.  please

    I need help with printing labels.  thanks in advance

    Welcome to Apple Support Communities.
    In Address Book, first select a name or group of names to print.
    Then File, Print, select Style, Mailing Labels, then Layout to select a specific target label (such as an Avery number), or define your own...

  • Need help w/printer

    i need help with my all in one  printer it will print sometime and sometime it won't but it won't print anything off the internet and it won't print off word pad either and when it does print everything come out backwards tell me what is wrong and what i need too do to get it too print the right way from left to right and not right to left please help this is a problem and i have a lot of stuff too print out before friday off the internet much appreciated. Connie Morgan

    i have a question about my hp deskjet F4240, i have been trying too print off the internet and word pad but it seem as everything is coming  out backwards or not printing at all my computer is saying that my dpi is 1200 which i don't know what that means but i need to know what i can do too get my printer too work  also i have never been able too scan anything on it and i would like too know how do i get it too scan also if u can help me out i would appreciate it so much and thank you for being here too help with my problem. Connie Morgan

  • Need help in printing text in footer

    Hi Friends,
    I need help from all you guys. I am working on SmartForms, and need help. Please look into the below situation, and appreciate if you can help me out.
    The Literal “**DATA CONTINUED ON NEXT PAGE**” is to be displayed at the bottom of the
      page in the Footer only if the data rolls onto second page.
    Thanks,
    Nikhil

    Hi,
    define the two variables in the global definition as
    g_cnt type sy-tabix.
    g_flg type c .
    ->in the initialization tab pass the internal table that is the main window.
    g_cnt = lines( the table name which you are using in the main
    window before the footer).
    Now you have the total no of lines in the g_cnt.
    in the loop which is in main window create the program line pass the output parameter as g_flg.
    in the condions tab give the condition as g_cnt = sy-tabix.
    in the source code of that program lines
    g_flg = 'X'.
    now for the footer where you are displaing the text coutinued on next page for in codition tab give the condition as g_flg = space.
    Thanks,
    NN.

  • Need Help with Print a Report

    Hi,
    I am building a database application in Java and now i need to print some reports ....
    I need to get the data from the database .. do some calculations , and then print in on paper.
    I checked online and got some tools like JasperReports, jfreereports, ReportCat, etc. so I was wondering if somebody can suggest whats the best.
    In my report I will have to print more than one table on one page.
    for example:
    if I have 4 Invoices. then i will have 4 tables .. one for each invoice.. and each table will contain
    the elements for that Invoice.If all can't fit on one page then it needs to go next page.
    I would like to do all this stuff in Java without using any reporting tool ... but I am not really sure how this can be
    done .. can someone give me an idea ... as per how this can be done .. will really appriciate all the help.
    Thanks in advance,
    sandsouza

    Hi,
    Can somebody please help me with this.
    Thanks in advance
    sandsouza

  • Need Help regarding Printing the report in Bi Publisher

    Hi,
    I have configured the printer successfully. But the problem is when i give the print in PDF format it coming in some symbols and for single page it is printing nearly 10 pages. When i gave print in HTML format then it is printing in Html tags.
    Please help me how to achieve this problem...
    Thanks& Regards,
    satish.e

    Usually the BEX is slower than the web applications.BEX needs a lot of resources on the client computer.
    Are you using any macors / VB code to do some processing before display the query output in BEX ?
    Ravi

  • Need Help in Printing

    Hey everyone;
    Im developing a Swing desktop application. it contains a kind of application form (JLabels, JTextFields, JCheckBox,..). I need to add a print application option. Both the labels and the user input should be printed. I have a problem with two things:
    1. including the user input in the priniting
    2. adjusting the margins
    Please not that im using GroupLayout (Netbeans).
    Thanks.

    Maybe you shold read this article on java-printing:
    http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-print.html
    hope that helps....
    regards....

  • Need help in printing text at back page using XML Publisher

    Hi,
    I need to print instructions (static text) at the back page of my report ouput using XML publisher. Oracle Application used is 11.5.10. Please help me to reslove.

    Hi,
    Did you see "Oracle XML Publisher User's Guide" manual available at --> http://www.oracle.com/technology/documentation/applications.html
    Regards,
    Hussein

  • Need help adding printer

    When I installed Tiger I chose to not install any printers, now I need to add an HP 895cse. The driver on HP's site is not working so I need to install the one from the tiger CD.
    Can someone tell me exactly how to do this?
    Thanks

    Hey,,thanks for the info..However
    I followed the instruction on installing the drivers from the Tiger CD but when I go in to add a printer in the printer utility, there's not a single printer listed..
    Help..

  • Need help on Printing Samrt Form via Web Dynpro

    Hi All !
    How can I print smartform that is displayed as PDF in web dynpro by clicking my custom button.
    I am unable to get solution please help me.
    Thanks & Regards!
    Krishna

    Hi Ragavendra !
    Thank you for telling but its not the solution for my problem .
    Actually I need a custom button "Print All' that prints all smart forms.
    Not individually by clicking print button.
    Thanks !

  • Need help with random numbers

    hi i need to generate 2 random numbers from array list . and then take out that two numbers from list.
         String[] plcard = { "AC", "KC", "QC", "JC",
              "10C", "9C", "8C", "7C","6C","5C","4C","3C","2C", "AD", "KD", "QD", "JD",
              "10D", "9D", "8D", "7D","6D","5D","4D","3D","2D", "AS", "KS", "QS", "JS",
              "10S", "9S", "8S", "7S","6S","5S","4S","3S","2S", "AH", "KH", "QH", "JH",
              "10H", "9H", "8H", "7H","6H","5H","4H","3H","2H",};
    this is the list if someone can help me i would appreciate
    thanks in advance

    haha, never noticed the .shuffle(List) method!
    maybe java is getting too convenient (just kidding)?
    i never wrote a card game.
    how would the more programmingly gifted of us do this?
    this is my shot at it for what its worth...
    public class Card{
    public Card(int rank, int suit){
    this.rank = rank;
    this.suit = suit;
    int rank (or String i suppose)
    int suit;
    static final club = 1;
    static final spade = 2;
    static final heart = 3;
    static final diamond = 4;
    public class Shuffler{
    public Shuffler(){
    int NumOfDecks = 1;
    Vector ShuffledDeck;
    // num of decks
    for(int i = 0; i < NumOfDecks){
    // 4 suits
    for(int j = 0; j < 4; j++){
    // 13 ranks
    for(int k = 0; k < 13; k++){
    ShuffledDeck.add(new Card(k, j));
    } // suits
    } // num of decks
    Collections.shuffle(ShuffledDeck);
    // Done?
    }

  • Need help verifying positive numbers

    I have a payroll program I've been working on for class the last few weeks. The most recent modification is that I need to confirm the hours and pay scale are entered in positive numbers. I've tried a while and an if...else statement and am getting an error telling me that I have an "illegal start" to the expression, and that the way I've written the statement is incompatible with boolean. Here is the code - I've colored the if...else statements red. The else statements don't give me an error, but the if statements do. (BTW, I've had the same problem trying to use a while statement.)
    I'm pretty sure it has something to do with how I've written the if statement, but I can't put my finger on it. Can someone help?
    Thanks,
    import java.util.Scanner; // program uses Scanner
    public class WeeklyPayrollTest
          public static void main(String args[])
            // create scanner to obtain input from command window
            Scanner input = new Scanner( System.in );
            // declare variables
            String exitPayroll;
            exitPayroll = "N";
            double numberHours = 0;
            double payRate = 0;
            // create a WeeklyPayroll object and assign it to currentPayroll
            WeeklyPayroll currentPayroll = new WeeklyPayroll();
            PayScale thisPay = new PayScale();
            while( exitPayroll.equalsIgnoreCase( "N" ) ) // begin while loop
                  // prompt for and input employee name
                  System.out.println( "Please enter employee name: " );
                  String nameOfEmployee = input.next(); // read user input
                  // prompt for and input hours worked
                  System.out.println( "Enter hours worked: ");
    {color:#ff0000}              if( input.nextDouble( <= 0 ) ) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number." ); // alert user positive numbers needed
                  numberHours = input.nextDouble(); // prompt for hours
                  else{
                  // prompt for and input hourly pay amount
                  System.out.println( "Enter hourly rate: ");
                  if(input.nextDouble( <= 0)) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number.") // alert user positive numbers are needed
                  payRate = input.nextDouble(); // prompt for rate of pay
                  else{
                  // call PayScale
                  double weeklyPay = thisPay.payScale( payRate, numberHours );
                  // call currentPayroll's displayMesage method and
                  // pass nameOfEmployee as an argument
                  currentPayroll.displayMessage( nameOfEmployee, weeklyPay );
    {color}             
                  System.out.println( "Would you like to exit this program? " +
                          "Enter Y for yes and N for no." );
                  exitPayroll = input.next(); // read user input
               } // end while loop
          System.out.println( "Thank you for using this payroll program." );        
        } // end main
    } // end class WeeklyPayrollTest

    if( input.nextDouble( )  <= 0) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number." ); // alert user positive numbers needed
                      numberHours = input.nextDouble(); // prompt for hours
    }This will through away the result. Try this
    numberHours = input.nextDouble;
    while ( input.nextDouble( )  <= 0) // compare input for positive numbers
                      System.out.println( "Only positive numbers are allowed. " +
                              "Please enter a correct number." ); // alert user positive numbers needed
                      numberHours = input.nextDouble(); // prompt for hours
    }

  • Need help for printing/exporting in the right format

    Hi,
    i'm layouting a magazine for my graduation class.  And I almost finished it, but I've got a problem with printing it like I want it to be printed. I use the newest Trial Version of Adobe InDesign. The format of the magazine is A4, but when I export it as PDF (printing is the same) two pages (each A5) are exported on one horizontal A4 page. I want to have each page on one A4. Can somebody help me and say what I have to do, to get it work in my way?
    I hope you can help me, and I'm sorry if this is a silly question, but InDesign is a very complicated Software
    Thanks

    Exporting to PDF shouldn't resize the page. Does the exported PDF look the way you want it to?
    Here's all you need to know to export the file:
    File > Adobe PDF Presets > (pick a format - if you're printing from a desktop printer High Quality Print is a good choice)
    It might give you a warning about Transparency Blend Space which you can change under Edit > Transparency Blend Space
    Make sure spreads is not checked.
    If the problem is happening from Acrobat, check all of the settings in your print dialogue.
    Good luck!

Maybe you are looking for