Example of call by value in C Program

C Programming Language >   Function in C Language >   Call by Value in C  

Long Question

919


Answer:


#include <stdio.h>  
void change(int,int);  
int main()  
{  
    int a=10,b=20;  
    change(a,b); //calling a function by passing the values of variables.  
    printf("Value of a is: %d",a);  
    printf("\n");  
    printf("Value of b is: %d",b);  
    return 0;  
}  
void change(int x,int y)  
{  
    x=13;  
    y=17;  
}  

Output

Value of a is: 10
Value of b is: 20


This Particular section is dedicated to Question & Answer only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.