I dunno if someone wants to take the time but I would be glad, I got this code from Sams Teach Yourself C Programming in 21 Days:
Now I get most of this but what I don't understand is when the program sends whatever the user entered to the function how does all of that work. Because it says 'long cube(long x)' and in the main part it has 'cube(input)'. I get confused when I look at the fuction because it is returning x_cubed, it uses only the variable x, so I don't see how or where input comes into play here or what they point of x is...I know this is a beginner question but so am I, thanks.Code:#include <stdio.h> long cube(long x); long input,answer; int main() { printf("Enter an interger value: "); scanf("%ld", &input); answer=cube(input); printf("\nThe cube of %ld is %ld.\n\n", input,answer); return 0; } long cube(long x) { long x_cubed; x_cubed=x*x*x; return x_cubed; }