Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- char message[100], ch;
- int i, key = 1;
- printf("Enter a message to decrypt: ");
- scanf("%s",&message);
- for(i = 0; message[i] != '\0'; i++){
- ch = message[i];
- if(ch >= 'a' && ch <= 'z'){
- ch = ch + key;
- if(ch < 'a'){
- ch = ch + 'z' - 'a' + 1;
- }
- message[i] = ch;
- }
- else if(ch >= 'A' && ch <= 'Z'){
- ch = ch - key;
- if(ch < 'A'){
- ch = ch + 'Z' - 'A' + 1;
- }
- message[i] = ch;
- }
- }
- printf("decodedE NAricht: %s", message);
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement