programming-examples/c/_Basic/C Program to Illustrate Pass by Reference.c

19 lines
281 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C Program to Illustrate Pass by Reference
*/
#include <stdio.h>
void cube( int *x);
int main()
{
int num = 10;
cube(&num);
printf("the cube of the given number is %d", num);
return 0;
}
void cube(int *x)
{
*x = (*x) * (*x) * (*x);
}