C Language - Call by Value and Call by Reference

 



#include <stdio.h>

#include <conio.h>

void referance (int* num, int* num2)

{

*num = *num + *num2;

// *num2 = *num2 - *num;

// *num2 = 332;

//

// int add = sum (num, num2);

// , int num2

}


int main () 


{

int a, b, c;

a=24;

b=23;


printf ("The value of a  is %d \n", a);

printf ("\n");

printf ("The value of b  is %d \n", b);

printf ("\n");


referance (&a, &b);

printf ("the sum of a+b is %d\n", a,b);

// printf ("the subraction of a-b is %d\n", a,b);


return 0;

}


// ScreenShots:









Comments

Popular Posts