ANSCII value of a character
C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
char a;
printf("Enter a character:");
scanf("%c",&a);
printf("ANSCII value character %c is %d",a,a);
}
Java Program
import java.util.Scanner;
public class Simpleprogram8 {
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.print("Enter a character:");
char a = s.next().charAt(0);
System.out.print("ANSCII Value of " + a + " is " + (int)a);
}
}
Python Program
x = input("Enter any character: ")
print("The ANSCII Value of " + x + " is: " + str(ord(x)) )
0 Comments:
Post a Comment