write a program that calculate the volume of cylinder after
user enters radius and height and show the algorithm used
Answer Posted / evangelist sammy gicheha
# include<iostream.h>
//using namespace std;
# define PI 3.142;
int main ()
{
int Rad,Height;
double area;
cout<<"Enter the radius;";
cin>>Rad;
cout<<"Enter the Height;";
cin>>Height;
area = 3.142 * Rad * Rad * Height;
cout<<"Radius="<<Rad<<endl;
cout<<"Height="<<Height<<endl;
cout<<"The Area of the circle is"<<area<<"\n";
return 0;
}
| Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
write a program that reads a series of strings and prints only those strings begging with letter "b"
develop a program to calculate and print body mass index for 200 employees
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
Code for Method of Handling Factorials of Any Size?
Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
how to write a program that opens a file and display in reverse order?
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
Write a simple encryption program using string function which apply the substitution method.
how to diplay a external image of output on winxp by using c & c++,