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

snake game Version-2 (using random number)

allocating dynamic memory using calloc

store a table in dynamic array and then change the size of array dynamically to store more numbers