/* * project2 * Chapter 4 * John Stile * Purpose: Test mycube in a program that includes the following code: * int xx, yy, zz; * xx=2; * yy=mycube(xx); * zz=myclube(mycube(mycube(mycube(xx)))); * printf("The value of xx is %d, yy is %d, and zz is %d\n", xx, yy, zz); * */ #include // include functions from stdio.h when compiling #include // include function pow int mycube(int xx) // header for function mycube. Takes an int, returns an int. { return pow(xx,3); // return the cube xx } int main(void) // header for function main { int xx, yy, zz; // declare 3 int variables xx=2; // assign xx a value of 2 yy=mycube(xx); // cube xx and assign to yy zz=mycube(mycube(mycube(mycube(xx)))); // cube xx, cube the result, cube the result, and cube the result. x to the (3*3*3*3) or 2 to the 81 -or- 2.417e24 printf("The value of xx is %d, yy is %d, and zz is %d\n", xx, yy, zz); // print result return 0; // return 0 to calling program }