Back To C++ User Defined Functions Index
//program to create a function that finds volume of a box (width, depth and height of box are passed to function as arguments) #include
#include
void volume(int,int,int); void volume(int width,int depth,int height) { int vol; vol=width*depth*height; printf("volume of box is %d",vol); } void main() { int w,d,h; clrscr(); printf("enter width of box "); scanf("%d",&w); printf("enter depth of box"); scanf("%d",&d); printf("enter height of box"); scanf("%d",&h); volume(w,d,h); getch(); }