Q:

write a c program demonstrate to call by reference

0

write a c program demonstrate to call by reference

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

#include<stdio.h>
#include<conio.h>
void add(int *a);
void main()
{
int x;
printf("enter any number");
scanf("%d",&x);
add(&x);
printf("\n after calling function variable value is %d",x);
getch();
}
void add(int *a)
{
*a=*a+10;
printf("\n in Called function variable value is %d",*a);
}

Output:

enter any number 10

 in Called function variable value is 20
 after calling function variable value is 20

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now