Answer to Question #11674 in Action Script | Flash | Flex | ColdFusion for fie

Question #11674
Problem Statement: You are required to write a program that prompts the user to enter the radius of circle as an input and display the circle’s diameter, circumference and area. Use the constant value 3.14159 for л. Perform each of these calculations inside the printf statements and use the conversion specifier %f.

(a) Write a pseudo-code to solve this problem.

(b) Write a full program using C programming language to solve this problem.
1
Expert's answer
2012-07-12T08:25:35-0400
Pseudo-code:

take radius
print radius²·pi
print 2pi·radius


# include<iostream.h>
# include<conio.h>

double pi = 3.1419, r;

void main(){
cout<<"Enter the radius of a circle: ";
cin>>r;
printf("The diameter of a circle is %f \n", 2*r);
printf("The area of a circle is %f \n", pi*r*r);
printf("The circumference of a circle is %f \n", 2*pi*r);
getch();
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS