Area and Volume problem on C

Asked By 20 points N/A Posted on -
qa-featured

I need a C code that allows a user to input data and computes its area and volume?

 
SHARE
Best Answer by Hoting Gracia
Best Answer
Best Answer
Answered By 5 points N/A #103297

Area and Volume problem on C

qa-featured

Hello Jersy,

Generally C is a programming language that is developed at AT & T's Bell Laboratories of USA in 1972 by Dennis Ritchie who Designed and written it completely and C became popular due to its ease of use and advantages.

Now coming to the program for finding the volume is just to know the logic of the program as logic is same in all languages but it differentiates only with the syntax.

Program is as follows…

#include<stdio.h> //Header Files

main ()//Execution starts here

{

float v,r,pi;//Initialising values of v , r and pi

pi=3.141593;//value of pi is 22/7

printf("Enter radius: ");//

scanf("%f",&r);//float value will get as output so %f
v=(4/3)*pi*r*r;/v=pi*r*r

printf("Volume is : %fn",v);//volume with variable v is displayed
}

Thank You.

Answered By 40 points N/A #103298

Area and Volume problem on C

qa-featured

You haven't specified the shape of the object which you want to calculate. Please be specific while asking questions here.

The example of finding the area of a something in C program.

I can't help you specifically unless you clearly defines in your Question the full details of the program to be created then only a specific algorithm i can formulate

#include<stdio.h>

#include<conio.h>

void main()

{

float a,b,area,volume;

printf("nn Please Enter Dimension 1 :- n");

scanf("%f",&a);

printf("nn Please Enter Dimension 2:- n");

scanf("%f",&b);

//Please write the formula here in order to calculate the dimension 1 and dimension 2 in the variables a and b respectively

//And they assign the area to the variable "area" and volume to the variable named "volume".

printf("nn Area is %f :-",area);

printf("nn Volume is %f :-",Volume);

getch();

}

Good luck.

Answered By 20 points N/A #103299

Area and Volume problem on C

qa-featured

Thank you Hoting Gracia and Lesten Pasio. 

The codes you gave were very helpful!

Continue helping!

Many thanks TechyV.

Related Questions