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 + ".");
}
}
}
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