Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to write a statement that appends the word \"Tournament\" onto the end of

ID: 3654133 • Letter: I

Question

I need to write a statement that appends the word "Tournament" onto the end of my string variable sport2. I'm not sure exactly what commands to use to do that. If it was an array I know how to do that but its just a string. I tried using the .append() command but that didn't work. I'll take any suggestions. And the other one I'm having difficult is also a string variable, not array, where I need to find if there is a int inside it. Not sure about how to go about doing that one easier. I know how to do it if its in an array but not just a string.

Explanation / Answer

use the built in function strcat(target,source) to join two strings. it is a built in function of C language. eg. if you want bombaynagpur then t = "bombay"; s = "nagpur"; strcat(t,s); printf("%s",t); this gives bombaynagpur