Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Square pyramid
//gcc 5.4.0 #include <stdio.h> double square(double side){ //The square function is calculating the square of the input// return(side*side); } double Volume(double side, double h){ //The volume functions calculates the volume using the square from the square funcion and height, which is inputed// return(square(side)*(h/3.0)); //The actual math is (a^2)*(1/3h) which is calculating the area of a square pyramid// } int main(void) { double x=10; //The main function initializes the two variables we are going to use// double y=3; //(side of a base, and height) even if they aren't called that// printf("Volume is %f\n", Volume(x,y)); //This prints the value returned from the volume function// return 0; //NOTE: the x and y are evaluated in the Volume function that they are called to as "side" and "h"// }
run
|
edit
|
history
|
help
2
printing numbers without using loop
150116_PrimoFactorial
factorial using function in c
Command Expressions in Gnu C
Lab6 v1.3Sin,cos,tan,cot
Project 5 v.03
PROTOTIPO PREGUNTA 1 DE GUÍA 4
print_odd_pointer.c
Lab 11 v1.0
str_ptr_to_fumc_v2