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

I need help Write a C program that plays the game of \"guess the number\'\' as f

ID: 2989989 • Letter: I

Question

I need help

Write a C program that plays the game of "guess the number'' as follows: Your program chooses the number to be guessed by selecting an integer at random in the range I to 1000. The program then types: The player then types a first guess. The program responds with one of the following: If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player Too high or Too low to help the player "zero in" on the correct answer. Write and test a function that subtracts element-wise 2 one-dimensional int array of the same size. For example, if the two given arrays are then the third array would be assigned: Write and test a function that multiplies element-wise 2 one-dimensional int arrays of the same size. For example, if the two given arrays are then the third array would be assigned Write and test the following function: The function "rotates" the first n elements of the array a, k positions to the right (or -k positions to the left if k is negative). The last k elements are rotated" around to the beginning of the array. For example, if a is the array shown below: then the call rotate(a, 8, 3) would transfer a into Note that all call rotate (a, 8, -5) would have the same effect. Write and test the following functions: void append (int a[], int m, int b[], int n) The function appends the first n elements the first n elements of the array b onto the end of the first m elements of the array a. It assumes that a has room for at least m +n elements. For example, if a and b look like this: then the call append (a, 8, b, 5) would transform a into Note that b is left unchanged, and only 5 elements of a are changed.

Explanation / Answer

5.32

Answer of first one

#include<stdio.h>
#include<stdlib.h>
#include <time.h>
int main()
{  
while(1)
{  
   /* Intializes random number generator */
   time_t tt;
   srand((unsigned) time(&tt));
   int t,n=rand()%999+1;
   printf("I have a number between 1 and 1000. Can you guess my number? Please type your first guess ");
   scanf("%d",&t);
   int i=0;
   while(t!=n)
   {
   i++;
   if (t<n)
       printf("%d. Too low. Try again. ",i);
   else
       printf("%d.Too high. Try again. ",i);
   scanf("%d",&t);
   }
   printf("Excellent! You guessed the number! Would you like to play again(y or n)? ");
   char c=getchar();
   if(c=='n')
   break;
}
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote