InterviewSolution
| 1. |
ASCII Value C |
|
Answer» ASCII Value C Example for ASCII Character Input and Output![]() In above example PROGRAM will display ascii value of the charcter variable that we have input in the screen. First user will give the character input then values of that value get stored in the "ch" variable. Then after that it will print value of "ch" variable by USING %c format specifier and it will display "A" because we have given the charcter input as "A". If we use %d as format specifier then ascii value will be displayed as 65. Output Enter a characterA The ascii value of the ch variable is : 65 Example for ASCII Character from 0-255 value of all characters![]() In above program this will print ascii value of all characters from 0 to 255 through the for loop. Example for ASCII Character for Given input![]() In above code we will TAKE input from user and then convert all character from input to ASCII values. And this will also provide the sum of all character of string in "sum" variable. |
|