Guest User

Untitled

a guest
Nov 4th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. /* Godzio 15 */
  2.  
  3. #include <stdio.h>
  4.  
  5. void CAPSLOCK(char str[]) {
  6.     int i;
  7.    
  8.     for (i=0;  str[i];  i++)
  9.         if ('a' <= str[i]  &&  str[i] <= 'z')
  10.             str[i] -= 0x20;
  11. }  
  12.  
  13. int main (void) {
  14.     char lancuch[] = "Przykladowy lancuch tekstowy";
  15.    
  16.     puts("Lancuch przed zmianami:");
  17.     puts(lancuch);
  18.    
  19.     CAPSLOCK(lancuch);
  20.    
  21.     puts("Lancuch po zmianach:");
  22.     puts(lancuch);
  23.    
  24.    
  25.  
  26.     return 0;
  27. }
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment