Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int n,i;
- scanf("%d",&n);
- char str[100];
- scanf("%s",str);
- for(i=0;i<strlen(str);i++)
- {
- str[i]=str[i]+n;
- if(str[i]>'z')
- str[i]=str[i]-26;
- }
- printf("Encoded word is %s\n",str);
- for(i=0;i<strlen(str);i++)
- {
- str[i]=str[i]-n;
- if(str[i]<'a')
- str[i]=str[i]+26;
- }
- printf("Decoded word is %s",str);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement