laseright that thats the way to do it
all the operations on the same time
thats what i am tryig to do
Code:#include <stdio.h> int merge(char str1[], int index1,char str2[],int index2, char result[], int index3); int merge_strings(char str1[], int index1,char str2[],int index2, char result[], int index3); int main() { char input[255]; char input2[255]; char result[510]; int index,flag,ch; printf("enter the first string \n"); for (index = 0; index < 254 && (ch = getchar()) != '\n' && ch >=0; ++index) { input[index] = ch; } input[index] = '\0'; printf("enter the second string \n"); for (index = 0; index < 254 && (ch = getchar()) != '\n' && ch >=0; ++index) { input2[index] = ch; } input2[index] = '\0'; flag=merge(input,0,input2,0,result, 0); if (flag) { printf("%s is valid.\n",result); } else { printf("%s is invalid.\n",result); } return 0; } int merge_strings(char str1[], int index1,char str2[],int index2, char result[], int index3) { int check,check2,check3,check4; if ((str1[index1]=='\0') && (str2[index2]=='\0')) { result[index3] = '\0'; return 1; } if (((str1[index1]<'a')||(str1[index1]>'z'))&&((str1[index1]<'A')||(str1[index1]>'Z'))) { if(str1[index1]<=str1[index1+1]) { return 0; } } else { check=merge_strings(str1,index1+1,str2,index2+1,result,index3+1); } }//end function



