Sunday, 11 December 2011

Write a program to use of function call by value in c

#include
#include
main()
{
int a;
a=200;
clrscr();
printf("\na=%d",a);
add(a);
printf("\nAFTER RETURN FROM FUNCTION a=%d",a);
getch();
}
add(int a)
{
a=a+200;
printf("\nIN FUNCTION a=%d",a);
return;
}

OUTPUT
A = 200
IN FUNCTION a = 400
AFTER RETURN FROM FUNCTION a = 200

No comments:

Post a Comment