/****************************************************************************
 * return2.c
 *
 * Computer Science 50
 * David J. Malan
 *
 * Cubes a variable.
 *
 * Demonstrates use of parameter and return value.
 ***************************************************************************/

#include <stdio.h>


// function prototype
int cube(int);


int
main(int argc, char *argv[])
{
    int x = 1;
    printf("x is now %d\n", x);
    printf("Cubing...\n");
    x = cube(x);
    printf("Cubed!\n");
    printf("x is now %d\n", x);
}


/*
 * int
 * cube(int a)
 *
 * Cubes argument.
 */

int
cube(int a)
{
    return a * a * a;
}