Sort line
-----------------
Enter a string (1-40 characters): CBA123fde[]aa
Output: aaabcdef
Above is the output i need..but i have done some code...and i dun have idea how to make it...could anyone help show me some easy example...
below is my code...i dont think is correct..please correct me
#include <stdio.h>
#include <stdlib.h>
#define LSIZE 50
int main(void)
{
int i;
char value;
char textInput[50];
int len;
printf("Sort Line\n");
printf("--------------------------------\n");
printf("Enter a string:");
scanf("%s",text Input);
len=strlen(text Input);
for (i=0; i <len; i++) {
value = textInput[i];
if (isalpha(value) ){
textInput[i]=value;
}
else if(isdigit(valu e))
{
textInput-textInput[i];
}else
{
textInput-textInput[i];
}
}
printf("%s\n", textInput);
}
/* loop back until EOF */
Help!!! Urgent
-----------------
Enter a string (1-40 characters): CBA123fde[]aa
Output: aaabcdef
Above is the output i need..but i have done some code...and i dun have idea how to make it...could anyone help show me some easy example...
below is my code...i dont think is correct..please correct me
#include <stdio.h>
#include <stdlib.h>
#define LSIZE 50
int main(void)
{
int i;
char value;
char textInput[50];
int len;
printf("Sort Line\n");
printf("--------------------------------\n");
printf("Enter a string:");
scanf("%s",text Input);
len=strlen(text Input);
for (i=0; i <len; i++) {
value = textInput[i];
if (isalpha(value) ){
textInput[i]=value;
}
else if(isdigit(valu e))
{
textInput-textInput[i];
}else
{
textInput-textInput[i];
}
}
printf("%s\n", textInput);
}
/* loop back until EOF */
Help!!! Urgent
Comment