Skip to content

Instantly share code, notes, and snippets.

@symtkn
Created October 10, 2011 21:02
Show Gist options
  • Save symtkn/1276532 to your computer and use it in GitHub Desktop.
Save symtkn/1276532 to your computer and use it in GitHub Desktop.
C'de şifreleme(öteleme ile)
#include <stdio.h>
#define ROT 13
int
main(void)
{
int c, c_yeni;
while((c = getchar()) != EOF){
if(c >= 'A' && c <= 'Z'){
if((c_yeni = c + ROT) <= 'Z')
putchar(c_yeni);
else{
c_yeni = c - ROT;
putchar(c_yeni);
}
}
else if(c >= 'a' && c <= 'z'){
if((c_yeni = c + ROT) <= 'z')
putchar(c_yeni);
else{
c_yeni = c - ROT;
putchar(c_yeni);
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment