Results 1 to 8 of 8
  1. #1
    pinar is offline Member
    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Default how do I find acsii character?

    prints the characters in the ASCII character table from '!' to '~'.

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

    Default

    e.g. here:ASCII-Table
    33-126
    but you do not need to know them, you could use char instead of int in a for loop :rolleyes:

  3. #3
    pinar is offline Member
    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Default

    /*(Displaying the ACSII character table) Write a program that
    prints the characters in the ASCII character table
    from '!' to '~'. Print ten characters per line. */

  4. #4
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

    Default

    yes and what is your question now? for the ten characters per line you could use modulus (%)

  5. #5
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default

    you could use char instead of int in a for loop

    and, in case you hadn't reaslised it, you can use the character constants in the for loop:

    Java Code:
    for(char ndx='!'; ndx <= '~'; ndx++)

    You will have to use a little imagination to get the % operator to detect every 10th character.

  6. #6
    pinar is offline Member
    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Default

    I cant do it.(Print ten characters per line):S:(

  7. #7
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    Quote Originally Posted by pinar View Post
    I cant do it.(Print ten characters per line):S:(
    Well, what have you done so far?

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,452
    Rep Power
    20

    Default

    Apart from waiting in the hope that some sucker will do your homework for you, that is.

    db

Similar Threads

  1. Convert integers into ACSII characters.
    By Valkyrie in forum New To Java
    Replies: 4
    Last Post: 11-24-2009, 03:39 AM
  2. How to check if character is 7 bit or 16 bit?
    By markthien in forum Advanced Java
    Replies: 2
    Last Post: 07-29-2009, 09:26 AM
  3. Read from a certain character to a certain character
    By blackstormattack in forum New To Java
    Replies: 0
    Last Post: 03-16-2009, 12:36 PM
  4. Character Object
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-07-2007, 01:04 PM
  5. reading text character by character
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-09-2007, 09:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •