strcpystr tirebounchon strcpystr4 dorwi strcatstrred What wi
strcpy(str, “tire-bounchon”);
strcpy(&str[4], “d-or-wi”);
strcat(str,”red?”);
What will be the value of the string str after the following statements have been executed? And explain why? strcpy(str, \"tire-bounchon\"); strcpy(&str;[4], \"d-or-wi\"); strcat(str, \"red?\");Solution
strcpy(str, “tire-bounchon”);
copy the string “tire-bounchon” to str
Output: in str
tire-bounchon
strcpy(&str[4], “d-or-wi”);
copy the string “d-or-wi” to str starting from index 4
Output: str
tired-or-wi
strcat(str,”red?”);
concatenate \"red?\" to str
Output: str
tired-or-wired?
Final output will be
tired-or-wired?
![strcpy(str, “tire-bounchon”); strcpy(&str[4], “d-or-wi”); strcat(str,”red?”); What will be the value of the string str after the following statements have b strcpy(str, “tire-bounchon”); strcpy(&str[4], “d-or-wi”); strcat(str,”red?”); What will be the value of the string str after the following statements have b](/WebImages/40/strcpystr-tirebounchon-strcpystr4-dorwi-strcatstrred-what-wi-1123110-1761598147-0.webp)
