#include<stdio.h> int main () { char word[128]; int i = 0; printf("Enter a word to encrypt:\n"); scanf(" %s",word); while(word[i]!='\0') { if(word[i]=='Z') { word[i] -=26; } else if(word[i]=='z') { word[i] -=26; } word[i] ++; // Handle edge cases i++; } printf("Encrypted: %s",word); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter