#include <stdio.h>
#include <string.h>
void transformString(char str[], char hole) {
for (int i = 0; str[i] != '\0'; i++) {
if (str[i] != ' ') { // Replace characters that are not spaces
str[i] = hole; // Replace with the specified "hole" character
}
}
}
int main() {
char str[100];
char hole;
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
printf("Enter the character to represent holes: ");
scanf(" %c", &hole); // Note the space before %c to consume any preceding whitespace
transformString(str, hole);
printf("Transformed string: %s\n", str);
return 0;
}