In C a character already is its ASCII value: char c= 'A'; printf ("%c is %d (0x%x hexa)\n", c, c, c);
Tab has a code in ASCII (9), and it has a backslash-sequence in C: \t
Ascii value of 5 is 53.
The ascii value of zero - is 48.
In order to print a character using its ASCII value, you need to first assign it to a char value like this: char c = (char) 65; In this example, we are casting the int 65 to a char, which converts it to an 'A', since 65 is the ASCII value for the capital letter 'a'. Next, you can print it out if you want: System.out.println(c); That's pretty much all there is to it!
#include#includevoid main(){char ch;clrscr();printf("enter to know ascii value");scanf("%c",&ch);printf("%d",ch);getch();}
\ is the character for 92 in ASCII.
//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; }
deepak
The ASCII value of capital K is 75. For a small k it is 107.
ASCII standardizes characters between 0 and 127.
There is no ASCII value of :-) ASCII encodes only single characters, assigning a numerical 0-127 value to each character. However, if you want the ASCII encoding of a smiley, here's some samples (using Hex values): :-) 0x3A2D29 :) 0x3A29