1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lakkis [162]
3 years ago
6

C++ CODE

Computers and Technology
1 answer:
cestrela7 [59]3 years ago
7 0

Answer:

#include <iostream>

#include <cmath>

#include <iomanip>

using namespace std;

int main()

{

   const double PI = 3.14159;

   double height;

   double radius;

   

   cout << "Enter the height of the cylinder: ";

   cin >> height;

   cout << "Enter the radius of the base of the cylinder: ";

   cin >> radius;

   cout << endl;

   cout << "Volume of the cylinder = " << setprecision(4) << PI * pow(radius, 2.0) * height << endl;

   cout << "Surface area: " << setprecision(4) << 2 * PI * radius * height + 2 * PI * pow(radius, 2.0) << endl;

   cout << endl;

   return 0;

}

Explanation:

Code is rearranged so that;

- Variables are defined,

- <em>height</em> and <em>radius</em> of the cylinder is asked from the user,

- The <u>volume</u> and <u>surface area</u> of the cylinder are calculated and printed. (<u>setprecision(4)</u> is used to print two decimal values)

You might be interested in
You are manually configuring a tcp/ip host. another administrator gives you the router's ip address. what is the tcp/ip term for
Nuetrik [128]
Answer: Default Gateway address
5 0
3 years ago
Read 2 more answers
When performing actions between your computer and one that is infected with a virus, which of the following offers NO risk of yo
Alexandra [31]

The one already infected, I think ..

6 0
3 years ago
I need help fixing this please
Shkiper50 [21]

Explanation:

I think that you might have used it a lot or its just a glitch and will come back after some time.

It might be that your screen cracked.

But try re-booting if that does not work, wait and take off the battery.

5 0
3 years ago
Read 2 more answers
If you want to create a line of code that will not appear in the interpreter, what symbol should begin the line?
kirill115 [55]

Answer:

endl

Explanation:

Note that endl must be free of quotation marks; otherwise, the program will treat it as a string.. The \n Character. The other way to break a line in C++ is to use the newline character

5 0
2 years ago
Will give brainliest!!!!!!!!
dolphi86 [110]

Answer:

d the overall strength of colours

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is a sigh that your computer may have been infected with malicious code
    12·1 answer
  • What part of the computer gives access to the internet
    10·1 answer
  • Write a program that ask the user to enter air water or Steele and the distance that a sound wave will travel in the medium the
    6·1 answer
  • Which software product release category is "generally feature complete and supposedly bug free, and ready for use by the communi
    7·1 answer
  • Your network has had long power outages that have caused Hyper-V servers to shut down after the UPS battery is drained. When pow
    8·1 answer
  • Rachel wants to post content from digital cameras on the web. Which online tool will help Rachel to post and edit content on a w
    5·1 answer
  • Which of the following statements about electronic cover letters is true?
    14·2 answers
  • All the network nodes are connected to each other
    8·1 answer
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
  • Easy<br> What is your favorite Anime<br> Mine is Attack On Titan at the moment
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!