Sunday, 15 December 2013

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);
}

Output

 Enter  file  name: pgm2.c
There are 43 lines in pgm2.c in a file

For More Details Please Visit Ictjobs.info

No comments: