@ozumsafa, Don't use gets() see the FAQ. Consider not hardcoding the size of input, your also going out of bounds of valid data (ie overstepping the end of the string).
consider:
Code:#include <stdio.h> int main(void) { char input[BUFSIZ]; size_t i = 0; fgets(input, sizeof(input), stdin); while(input[i] != '\0') { if(input[i] == '-') input[i] = '_'; i++; } return 0; }