encryption and decryption of a string

 #include<stdio.h>

void encrypt(char str[]);
void decrypt(char str[]);
int main()
    {
char str[100];
gets(str);
encrypt(str);
decrypt(str);
    }

void encrypt(char str[])
{

for(int i=0;str[i]!='\0';i++)
{
    str[i]=str[i]+1;

}
puts(str);
}
   
void decrypt(char str[])
{
    for(int i=0;str[i]!='\0';i++)
    {
        str[i]=str[i]-1;
    }
    puts(str);
}

Comments