// Input two strings s and t from the user. Assume that the strings do not // contain blank or any whitespace character. // Write a function that concatenates t to s, i.e., it modifies s by appending t to it. // The parameters of the function concat contains only pointers to characters (not // arrays): // void concat(char *s, char *t) //Author:rahule@iitk.ac.in #include void concat(char *s, char *t); int string_length(char *); main() { char s[100],t[50]; printf("\nEnter the string to be appended [s] :"); scanf("%s",s); printf("\nEnter the string which the first string has to be appended with [t] :"); scanf("%s",t); concat(s,t); //conactinates t with s and stores the reulst in S printf("Modified String is : %s\n",s); } void concat(char *s, char *t) //concatinates strings pointed by the pointers s,t { int l; l=string_length(s); //find the length of string S s=s+l; //pointer to the first string is moved to the end of the string while(*t != '\0') //till the end of second string,do the followig { *s=*t; //copy the contents of t to s s++; t++; } *s='\0'; //to make the new appended string in s valid,append a '\0' at the end } int string_length(char *s) //function to find the string length { int i; for(i=0;s[i]!='\0';i++); //loop until s[i] = '\0' return(i); }