Facebook

adsense

Tuesday, 3 March 2015

CHECK ASCII NUMBER OF ANY CHARACTER --> JAVA CODE

import java.util.Scanner;
public class CharToASCII
{
 public static void main(String args[])
 {
  Scanner input = new Scanner(System.in);
  System.out.println("Enter the char:");
  String str = input.nextLine();
  for ( int i = 0; i < str.length(); ++i )
 {
  char c = str.charAt(i);
  int j = (int) c;
  System.out.println("ASCII OF "+ c +" = " + j + ".");
  }
}
}

No comments:

Post a Comment