un programme pour trie les chaines du mot de votre choix





un programme pour trie les chaines  du mot de votre choix

 ///Author: Karara Mohamed  @   tutodev1.blogspot.com/
///un programme pour trie les chaines  du mot de votre choix
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{int n,i,num;
char z;

  char t[100];
  printf("donnez votre mot:");
  scanf("%s",t);
  num=strlen(t);
  while(n!=0){
           n=0;




           for(i=0;i<num-1;i++){
           if(t[i]>t[i+1]){
                           n++;
                           z=t[i];
                           t[i]=t[i+1];
                           t[i+1]=z;
                           } }
              }
     for(i=0;i<num;i++){
                      printf("%c\n",t[i]);
                       }

  system("PAUSE");
  return 0;
}