Q:

Write a c program to demonstrate Call by value

0

Write a c program to demonstrate Call by value

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 10

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 demonstrate to call by reference... >>
<< Write a program to reverse a string without using ...