Question: C Language 1. Please save the program with the name cal.c Write a program to input two integer values and out their sum and their

C Language

1. Please save the program with the name cal.c Write a program to input two integer values and out their sum and their difference. A sample run off the program follows. The user input is represented in boldface in the sample run. (page. 56, C by Discovery 4th edition, by Foster & Foster) Example: Enter an integer: 45 Enter another integer: 83 45 + 83 = 128 45 83 = -38

2. Please save the program with the name guess.c Write a C program that plays a number guessing game with the user. A sample run for the game follows. User input is shown in boldface in the sample run. (C by discovery) Welcome to the game of Guess It! I will choose a number between 1 and 200. You will try to guess that number. If you guess wrong, I will tell you if you guessed too high or too low. You have 5 tries to get the number. OK, I am thinking of a number. Try to guess it. Your guess? 50 Too high! Your guess? 12 Too low! Your guess? 112 Too high! Your guess? 250 Illegal guess. Your guess must be between 1 and 200. Try again. Your guess? 30 **** CORRECT **** Want to play again? y Ok, I am thinking of a number. Try to guess it. Your guess? 58 **** CORRECT **** Want to play again? n Goodbye, It was fun. Play again soon.

The following code will print out a random generator between 1-100 ten times. Example: #include #include int main() { int c, n; printf("Ten random numbers in [1,100] "); for (c = 1; c <= 10; c++) { n = rand() % 100 + 1; printf("%d ", n); } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!