C program to replace white spaces with underscore and to uppercase all characters in a string

//C program to replace white spaces with underscore
// and to uppercase all characters in a string
#include <stdio.h>
#include<conio.h>
#include<string.h>

int main()

{

char input[50], output[50];
int i = 0, j = 0, count = 0;

printf("Enter intput string in lowercase\n");
gets(input);
printf("input string is  %s \n",input);

count = strlen(input);

for(i = 0; i<count; i++)  

{   
     if(input[i]==' ')
        output[j] = '_';
         else
         output[j]=input[i]-32;
          j++;
}

output[j] = '\0';

 printf("output string is  %s \n",output);
getch();
 return 0;             

}

Output:




C program to replace white spaces with underscore and to uppercase all characters in a string