Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (void){
- char character, CapChar;
- printf("Enter a character: ");
- scanf("%c", &character);
- CapChar = character-32;
- printf("\n************************************************\n");
- printf("\n\tThe small character is: %16c\n", character);//Enters the small character//
- printf("\nThe decimal number of the small character is: %2d\n", character); //Turn the small Character into Decimal Value (number)//
- printf("\n\tThe capital letter is: %17c\n", CapChar); //Enters the capital letter by subtracting Character to 32 (Use addition to enter small character)//
- printf("\nThe decimal number of the capital letter is: %3d\n", CapChar); //Turn the capital Letter into Decimal Value (number)//
- printf("\n************************************************\n"); //Latter can work. Enter a capital Letter, and it will show the decimal value and small character//
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement