Computer Science, asked by gauravtamang3899, 1 year ago

write a program in java to accept a word and display the ascii of each character

Answers

Answered by srijan041
11
It's only a snippet.

private int getAsciiValue(char ch){
return (int)ch;
}

And in main method, pass the characters as parameter to this method. Like,

String word = "Hello";
for(int i = 0; i < word.length(); i++){
char ch = word.charAt(i);
ob.getAsciiValue(ch);
}
Similar questions