ACCU WEATHER

ASCII value of given character

Given a single character "S" print the ASCII value of it.
Input Format
Single character represents the character S.
Constraints
All the characters are printable characters.
Output Format
Single line of output represents the ASCII value of given character
Sample Input 0
A
Sample Output 0
65
Explanation 0
Given Character is A. The Ascii Vaule of it is 65.
Sample Input 1
;
Sample Output 1
59
Source Code:
import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner ik=new Scanner(System.in);
        char a=ik.next().charAt(0);  
        int as = (int) a;
        System.out.println(as);
        
    }
}

Popular posts from this blog

Integer Addition

Sum of alternative Numbers

IsEven