Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3. #include <string.h>
  4. int main(void)
  5. {
  6. string s = get_string();
  7. if (s != NULL)
  8. {
  9. for (int i = 0, n = strlen(s); i < n; i++)
  10. {
  11. if (s[i] >= 'a' && s[i] <= 'z')
  12. {
  13. printf("%c", s[i] - 32);
  14. }
  15. else
  16. {
  17. printf("%c", s[i] - 32);
  18. }
  19. }
  20.  
  21. }
  22. else
  23. {
  24. printf("%c", s[i]);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement