TheBlackPopeSJ

Homework 3, Problem 9

Feb 3rd, 2021 (edited)
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <math.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <conio.h>
  6.  
  7. void main()
  8. {  
  9.     char strLetter = "";
  10.     char strLowerCaseLetter = "";
  11.  
  12.     do
  13.     {
  14.         printf("%c", strLetter);
  15.         printf("Please enter an uppercase letter. \n");
  16.         scanf("%c", &strLetter);
  17.        
  18.  
  19.         if (strLetter >= 'A' && strLetter <= 'Z')
  20.         {
  21.             strLowerCaseLetter = strLetter + 32;
  22.             printf("Here is the letter in uppercase: %c. Here is the letter in lowercase: %c.", strLetter, strLowerCaseLetter);
  23.         }
  24.  
  25.     } while (strLetter < 'A' || strLetter > 'Z');
  26. }
Advertisement
Add Comment
Please, Sign In to add comment