Program to encrypt message or number using c programming
// program to encrypt a message
#include<stdio.h>
#include<string.h>
int main() {
char input[100];
char encrypted[100];
printf("enter msg/no. :");
scanf("%s", input);
printf("\033[H\033[J");
int length = strlen(input);
encrypted[0] = input[0];
encrypted[1] = input[1];
for(int j = 2; j < length; j++) {
encrypted[j] = 'x';
}
encrypted[length-2] = input[length-2];
encrypted[length-1] = input[length-1];
printf("%s",encrypted);
}
Comments
Post a Comment