answersLogoWhite

0

You don't need to write a program to do this. Each character (char) is actually an int. If you want to see the ASCII value of a char you can simply:

char c = 'a';

System.out.print( (int)c );

User Avatar

Wiki User

17y ago

What else can I help you with?

Continue Learning about Engineering

Write a C program to accept a string from user and display its ascii value and then display sum of all ascii value of strings?

//C program to accept a string from user and //display its ascii value and //then display sum of all ascii value of strings #include<stdio.h> #include <string.h> int main() { char String[100]; int Sum,Index; Sum=0; //Sum is initially zero printf("Enter the string:\n"); gets(String); //Accept String from User for(Index=0;Index<strlen(String);Index++) { Sum+=(String[Index]); //Adds (the ASCII values of) the String characters. } printf("The sum is %d\n",Sum); //Printing it as %d gives the equivalent ASCII value. return 0; }


How to write a program to accept the user name and password and then shop this is your Password?

you cant


Use an assembler directive to store the ASCII-character string What time is it in the memory?

To store the ASCII character string "What time is it" in memory using an assembler directive, you can use the .ascii or .asciz directive. For example, in assembly language, you can write: .data timeString: .asciz "What time is it" This directive allocates memory for the string and includes a null terminator, making it suitable for string handling in many programming contexts.


Write a program to enter a character and it will tell the character etered?

{char a;...cout > a;cout


Write A-Z in ASCII code?

A = 0x41 = 65 B = 0x42 = 66 C = 0x43 = 67 ... Y = 0x59 = 89 Z = 0x5A = 90 However, note that depending on a particular numeric or bit value for a character is not always portable. It depends on the implementation.

Related Questions

Write a C program to accept a string from user and display its ascii value and then display sum of all ascii value of strings?

//C program to accept a string from user and //display its ascii value and //then display sum of all ascii value of strings #include<stdio.h> #include <string.h> int main() { char String[100]; int Sum,Index; Sum=0; //Sum is initially zero printf("Enter the string:\n"); gets(String); //Accept String from User for(Index=0;Index<strlen(String);Index++) { Sum+=(String[Index]); //Adds (the ASCII values of) the String characters. } printf("The sum is %d\n",Sum); //Printing it as %d gives the equivalent ASCII value. return 0; }


Why would you use ASCII instead of Binary?

ASCII = American Standard Code for Information InterchangeThat means that ASCII is a type of character encoding...Unless you want to write in 1's and 0's, then you must use ASCII. If you type a single character, it's most likely ASCII. To show you how ridiculous typing in binary is:011101110110100101101011011010010010000001100001011011100111001101110111011001010111001001110011 = wiki answers (lowercase)


American standard for information interchange ASCII?

ASCII is code in which computer programs are written . it is the computer machine language.if write a program in any computer language thaen it will be converted in this code.


How do you write that's not nice in binary?

To write the phrase "that's not nice" in binary, you first need to convert each character into its ASCII value and then represent that value in binary. For example, the letter 't' is 116 in ASCII, which is 01110100 in binary. Following this method for each character in the phrase, you would get a sequence of binary numbers corresponding to each character, including spaces.


How do you write BASIC program to accept variables?

dim a input a


Write a Java program to get the ASCII value of the given number?

If you look up the ASCII values for digits, you'll see that 0 = 48, 1 = 49... 9 = 57. So it's a simple matter of adding 48 to your digit to find out the ASCII value for it.


Write a c program to accept a numbers and generate square root cube and exponential values?

write a c program to accept a number and generate a square root cube and exponential values


How do I write a program that converts sentences into Morse code?

This is done with an algorithm that takes a text string and process each letter in turn. In computing text letters are usually coded as ASCII characters where the character is encoded as a specific numeric value. The algorithm will obtain this value and use it as in index into an array storing the Morse Code representation for every ASCII character. The output of the algorithm with thus be a Morse translation of the text input.


How do you use codes?

To write secret letters if you are a spy. To write computer programs. To deal with character sets (ASCII etc) To know how to behave and dress (social and dress code)


How to write a program to accept the user name and password and then shop this is your Password?

you cant


Use an assembler directive to store the ASCII-character string What time is it in the memory?

To store the ASCII character string "What time is it" in memory using an assembler directive, you can use the .ascii or .asciz directive. For example, in assembly language, you can write: .data timeString: .asciz "What time is it" This directive allocates memory for the string and includes a null terminator, making it suitable for string handling in many programming contexts.


Write a program to print all the ascii values and the corresponding representation?

int main (void) { int i; for (i=32; i<=127; ++i) printf ("%3d: '%c'\n", i, i); }