Advertisement
Sierra_ONE

Conversion: ASCII Table

Sep 17th, 2023 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | Source Code | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (void){
  4.  
  5.    
  6.     char character, CapChar;
  7.     printf("Enter a character: ");
  8.     scanf("%c", &character);
  9.     CapChar = character-32;
  10.     printf("\n************************************************\n");
  11.     printf("\n\tThe small character is: %16c\n", character);//Enters the small character//
  12.     printf("\nThe decimal number of the small character is: %2d\n", character); //Turn the small Character into Decimal Value (number)//
  13.     printf("\n\tThe capital letter is: %17c\n", CapChar); //Enters the capital letter by subtracting Character to 32 (Use addition to enter small character)//
  14.     printf("\nThe decimal number of the capital letter is: %3d\n", CapChar); //Turn the capital Letter into Decimal Value (number)//
  15.     printf("\n************************************************\n"); //Latter can work. Enter a capital Letter, and it will show the decimal value and small character//
  16.  
  17.    
  18.    
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement