A variable of type double named area holds the area of a circle. Write a statement to
output on the screen the area in two decimal places

Recommended Answers

All 2 Replies

printf will allow you to format output as you'd like.

double area = ...;
printf ("Area: %0.2f\n", area);
commented: Great! +0

So doris, to you remember what the equation is to compute the area of a circle? You want us to do your homework for you? Give us a break! It is tiring to keep getting requests to solve simple homework assignments. READ THE FARKING BOOK!

Sorry, but it has been a long day. I had to install and configure major application servers on two Windows server systems today (remotely) and I am tired... The servers were in Bermuda, but unfortunately I was not able to arrange a site visit, sigh.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.