I could've swore I attached the file lol but oh well, but yea heres what I have so far and that's good news about it being able to be done without the string library.
Basically what I'm trying to do is assign the letter to numbers and sort them that way, but im not sure if im doing it right.
insert
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x,i;
printf("How many words do you want alphabetized?\n");
scanf("%d", &x);
char Words[x];
for (i=0; i<x; i++) {
printf("\nEnter a word:");
scanf ("\n%s" , Words[i]);
}
printf("\nThese are all the words:");
for (i=0; i<x; i++) {
printf ("\n%s" , Words[i]);
}
int A;
for(A=1;A<=(x-1);A++){
for(i=1;i<x;i++){
a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=9, j=10, k=11, l=12, m=13, n=14, o=15, p=16, q=17, r=18, s=19, t=20, u=21, v=22, w=23, x=24, y=25, z=26;
if(Words[i-1]<Words[i]);
{store=Words[i-1];
Words[i-1]=Words[i];
Words[i]=store;}
}
}
printf("\nThese are all the words sorted alphabetically:");
for (i=0; i<x; i++) {
printf ("\n%s" , Words[i]);
}
printf("\n");
}