finally I did it.. wheew im starting to love this programming thing.. maybe I should take on this... 2 days of learning this stuff... and I come up with this
Code:#include<conio.h> #include<stdio.h> #include<string.h> void main() { int i, j; char str[30]; char temp; clrscr(); printf("please enter a string: "); gets(str); for(j = 0; j < strlen(str); j++) { for(i = 0; i < strlen(str); i++) { if(str[i] < str[i+1]) { temp = str[i+1]; str[i+1] = str[i]; str[i] = temp; } } } printf("\noutput: "); for(i = strlen(str); i >= 0; i--) printf("%c",str[i]); getch(); }