101k views
5 votes
Write a program to input an integer num from the keyboard and: : find the area of a square whose side length is num. : find the volume of a sphere whose radius is num. : find the length of the side of a square whose area is num.

1 Answer

5 votes

Answer:

# include<iostream>

# include<math.h>

using namespace::std;

void calc (int num)

{

cout<<"Area of Square" <<num*num;

cout<<"Volume of a sphere" << (4/3) *3.14*num*num*num;

cout<<"Side of a Square" <<sqrt(num);

}

int main ()

{

int num;

cout<<"Enter the Number"; cin>>num;

calc(num);

return 0;

}

Step-by-step explanation:

I have used the swtich for the selection purpose. Also, I have used sqrt() function, and for that I have included math,h library. And the various formula comes from mensuration. Rest part is self explanatory.

User BlackSheeep
by
7.2k points