Exercises
See Appendix A, Exercise Answers for answers.
- Write a program that computes the circumference of a circle with a radius of . The circumference is 2
times the radius, or about times .
- Modify the program from the previous exercise to prompt for and accept a radius from the person running the program.
- Write a program that prompts for and reads two numbers, and then prints out the result of the two numbers multiplied together.
- Write a program that reads a string and a number, and then prints the string the number of times indicated by the number on separate lines. (Hint: use the
xoperator.)