Write a code snippet to declare and accept an integer and calculate the cube value of the integer. The integer should be passed by reference to a function cube(). The function would calculate the result of cubing the integer.

The function prototype to be used is: void cube (int *p);

Sample input-output
Please enter an integer: 2
The cube of integer 2 is 8

i think the accepted practice here is that you post where you reach with the code to recive feedback

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.