Editorial Staff - - C Programming Tutorial
In the pass by reference, the address of data is pass to the called function. Using & operator we can determine the address of the data item.
We have designed this program for beginners for learning purpose. Copy below c program and execute it with c compiler to see the output of the program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #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); } |
the cube of the given number is 1000
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff