Kod:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
FILE *yaz;
yaz = fopen("deneme.txt","w");
char *isim[10]={"Ali","Kemal","Ayse","Can","Beren","Fatih","Selim","Talat","Mehmet","Haluk"};
char *temp;
for (int i=0;i<10;i++){
for (int j=0;j<9;j++) {
if (strcmp(isim[j],isim[j+1])>0)
{
temp=isim[j];
isim[j]=isim[j+1];
isim[j+1]=temp;
}
}
}
for (int i=0;i<10;i++){
puts(isim[i]);
fprintf(yaz," %s",isim[i]);
}
system("PAUSE");
return 0;
}