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)

C Programming Exercises With Solutions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a c program using switch case to calculate t... >>
<< Write a c program to demonstrate Call by value...