Decrypt a string

 #include <stdio.h>

void decrypt(char *c)
{
    char *ptr=c;
    while(*ptr!='\0')
    {
        *ptr=*ptr-1;
        ptr++;
    }
}
int main(){
char str[]="Bobzb";
decrypt(str);
printf("The decrypted string is:%s",str);
 return 0;
}

Comments

Popular posts from this blog

comparing 2 dates using structures

free dynamic memory allocation

prime number