C program to sort characters in a word

C program to sort characters in a word

#include <stdio.h>
#include <string.h>  

int main(void){
	
	char temp;
	int i, j;
	
	// declare string (character array) to hold the input string
	char inputString[100];
	
	// prompt the user to enter a string
	printf("Enter a single word: ");
	
	// get the input
	scanf("%s\n", inputString);
	
	printf("Original string -> %s \n", inputString);
	
	int n = strlen(inputString);
	
	for(i = 0; i < n-1; i++){
		for(j = i+1; j < n; j++){
			if(inputString[i] > inputString[j]){
				temp = inputString[i];
				inputString[i] = inputString[j];
				inputString[j] = temp;
			}
		}
	}  
	
	printf("After sorting -> %s \n", inputString);
	
	return 0;
	
	}