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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site