Question: 1. (10 pts) Consider the following code. char strl20 int x, Y scanf(%d%s%d, &x, str, &y); What will be the values of x, y and


1. (10 pts) Consider the following code. char strl20 int x, Y scanf("%d%s%d", &x, str, &y); What will be the values of x, y and str if the user types the following: 100dogsand1 200dogsand2 2. (20 pts) What is the value of movie after each statement (lines 2-5)? char movie[100]; strcpy(movie, "Beauty and the Beast"); /* Line 2*/ movie [4]10 strcpy(movie + 4, ""); strcat(movie, "- Disney") *Line 3 *Line 4 Line 5* 3. (30 pts) Write statements for the following. Make sure to declare any variables needed (10 pts) Read a string called string1 from the standard input (at most 100 characters). Your string must not unnecessarily waste space. a. (10 pts) Create a new string by duplicating the above string1 into string2 (for example, if string 1 is knock, string 2 becomes knockknock). Your string2 must not unnecessarily waste space. b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
