//C Program to Sort an array of names or strings
#include <stdio.h>
#include<math.h>
void main()
{
    int n;
    printf("ENTER LENGTH OF THE STRING =\n");
    scanf("%d",&n);
    char str[n],str1[n],str2[n];
    printf("enter your first string =\n");
    scanf("%s",str);
    printf("enter your second string =\n");
    scanf("%s",str1);
    printf("enter your third string =\n");
    scanf("%s",str2);
        if(str[0]<str1[0]&&str[0]<str2[0]){
            printf("YOUR new first STRING =%s\n",str);
            if(str1[0]<str2[0])
              {  printf("YOUR new second STRING =%s\n",str1);
                printf("YOUR new third STRING =%s\n",str2);}
                else{
                    printf("YOUR new second STRING =%s\n",str2);
                printf("YOUR new third STRING =%s\n",str1);} 
                    
                }
                
        
       else if(str1[0]<str[0]&&str1[0]<str2[0]){
            printf("YOUR new first STRING =%s\n",str1);
         if(str2[0]<str[0])
              {  printf("YOUR new second STRING =%s\n",str2);
                printf("YOUR new third STRING =%s\n",str);}
                else{
                    printf("YOUR new second STRING =%s\n",str);
                printf("YOUR new third STRING =%s\n",str2);} 
                    
                }
    else    if(str2[0]<str1[0]&&str2[0]<str[0]){
            printf("YOUR new first STRING =%s\n",str2);
         if(str1[0]<str[0])
              {  printf("YOUR new second STRING =%s\n",str1);
                printf("YOUR new third STRING =%s\n",str);}
                else{
                    printf("YOUR new second STRING =%s\n",str);
                printf("YOUR new third STRING =%s\n",str1);} 
                    
                }
        
        
    }
    
    
    

      
 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: