Pseudo code to find volume of cube,sphere and cylinder in c language
Answers
Answered by
1
#include <>
Function main()
begin
Real Vol, Len, Rad, Ht ; character shape;
output("What shape ? ")
input(shape);
case (shape) of
'c' : ouput("input length of side") ; input(Len); Vol = Len^3 ;
's' : output("input radius") ; input(Rad); Vol = 4/3*Pi*Rad^3 ;
'l' : output("input radius, height"); input(Rad, Ht); Vol = 2*Pi * Rad*Ht
end case
output("Volume is " , Vol);
end main
Function main()
begin
Real Vol, Len, Rad, Ht ; character shape;
output("What shape ? ")
input(shape);
case (shape) of
'c' : ouput("input length of side") ; input(Len); Vol = Len^3 ;
's' : output("input radius") ; input(Rad); Vol = 4/3*Pi*Rad^3 ;
'l' : output("input radius, height"); input(Rad, Ht); Vol = 2*Pi * Rad*Ht
end case
output("Volume is " , Vol);
end main
Similar questions