Area and Volume problem on C
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.
Area and Volume problem on C
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.
Area and Volume problem on C
Thank you Hoting Gracia and Lesten Pasio.Â
The codes you gave were very helpful!
Continue helping!
Many thanks TechyV.