Question
Exercise B: (Area of a Circle) This program calculates the area of a circle. The formula for the area of a circle is PI times
Exercise B: (Area of a Circle)
This program calculates the area of a circle. The formula for the area of a circle is PI times the radius squared. PI = 3.14159
- Ask the user to enter the radius of a circle.
- Calculate the area of the circle and display the number up to 2 decimal points.
(To set the decimal point include, #include
- You must declare PI as named constant.
- You must use math function pow() to square the radius. Do not write radius * radius.
(You need to include, #include
Test Case:
Run your program two times. First time enter the value of the radius = 12. Second-time radius = 5.23.
Here is the expected output. Your code should be able to handle any number entered by the user. I am just giving you these 2 numbers to check the accuracy of your code.
Exercise C: (Simple Math)
Write a program that produces the following output (make sure you pay attention to spaces, lines, and upper- and lower-case). Use only variables of int type.
Your output must match with my output. If there is space between 2 lines, your output must show that space.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started