Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
1
Please
log in
to post a comment.
intro coding hello world
A.c
Struct
Project 3 Part 1 v1.7
sume of diagonal v.1
3-D array sum and search
PREGUNTA 10 CADENAS
Assignment 4
AVANCE 1 TAREA M4 - PERLAS
multi dimension sum
stackse - search stackoverflow differently
Please log in to post a comment.