Write a program for call by value.

Write a program for call by value.

 

#include<stdio.h>

#include<conio.h>

void abc(int x)

{

x=100;

printf("x=%d",x);

printf("\n");

}

void main()

{

int a=30;

clrscr();

printf("a=%d",a);

printf("\n");

abc(a);

printf("a=%d",a);

getch();

}

=======================================================

 

OUTPUT:

 

a=30

x=100

a=30

 

 

 


Comments