Write a program for the demonstration of call by value

//this is a program for the demostration of call by value
#include<stdio.h>
#include<conio.h>
void display(int num);
void main()
{
int num;

printf("\n\nEnter any number: ");
scanf("%d",&num);

display(num);

printf("\n\nActual parameters after calling the function = %d",num);
getch();
}
void display(int num)
{
num=num+10;


printf("\n\nFormal parameters in the function = %d",num);
}

Previous
Next Post »