Guest User

Untitled

a guest
Dec 11th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. char kisbetuve(char c);
  5. char nagybetuve(char);
  6.  
  7.  
  8. int nagykisbetu()
  9. {
  10. printf("Megvaltoztatom a betud nagysagat\n");
  11. printf("Kerek szepen egy szoveget: \n");
  12. char c;
  13.  
  14. while(scanf("%c",&c)==1)
  15. {
  16. if (c>='a'&&c<='z')printf("%c",nagybetuve(c));
  17. else if(c>='A'&&c<='Z')printf("%c",kisbetuve(c));
  18. else printf("%c",c);
  19. }
  20.  
  21. return 0;
  22. }
  23.  
  24. char nagybetuve(char c)
  25. {
  26. return c=c-'a'+'A';
  27. }
  28.  
  29. char kisbetuve(char c)
  30. {
  31. return c=c-'A'+'a';
  32. }
Add Comment
Please, Sign In to add comment