Write a program which will read a string and rewrite it in the alphabetical order. For example, the word STRING should be written as GINRST Test Case 1 Input (stdin) string Expected Output ginrst Test Case 2 Input (stdin) srmuniversitylearningcentre Expected Output aceeeegiiilmnnnnrrrrssttuvy
#include<stdio.h>
int main()
{
char str[100],temp;
int i,j;
scanf ("%[^\n]s",str);
for(i=0;str[i];i++)
{
for(j=i+1;str[j];j++)
{
if(str[j]<str[i])
{
temp=str[j];
str[j]=str[i];
str[i]=temp;
}
}
}
printf("%s",str);
return 0;
}