#include <stdio.h>
#include <conio.h>
int "call-by-value"(int, int);
void "call-by-address"(int*,int*,int*,int*);
void main()
{
int a=6,b=10,sum,mul;
clrscr();
printf("\n&a= %d\n&B= %d\n&SUM= %d\n&MUL= %d",&a,&b,&sum,&mul);
sum= "call-by-value" (a,b);
printf("\n\n%d+%d=%d",a,b,sum);
printf("\nA= %d, B= %d",a,b);
"call-by-address"(&a,&b,&sum,&mul);
printf("\n After swapping:\nA= %d, B= %d,\nSUM =%d,\nMUL= %d",sum,mul,a,b);
}
int "call-by-value" (int x, int y)
{
int z;
x=65;
z=x+y;
return(z);
}
void "call-by-adderss" (int*m,int*n,int*q,int*r)
{
int p;
*m=65;
p=*m;
*m=*n;
*n=*p;
*q=*m+*n;
*r=*m**n;
}
#include <conio.h>
int "call-by-value"(int, int);
void "call-by-address"(int*,int*,int*,int*);
void main()
{
int a=6,b=10,sum,mul;
clrscr();
printf("\n&a= %d\n&B= %d\n&SUM= %d\n&MUL= %d",&a,&b,&sum,&mul);
sum= "call-by-value" (a,b);
printf("\n\n%d+%d=%d",a,b,sum);
printf("\nA= %d, B= %d",a,b);
"call-by-address"(&a,&b,&sum,&mul);
printf("\n After swapping:\nA= %d, B= %d,\nSUM =%d,\nMUL= %d",sum,mul,a,b);
}
int "call-by-value" (int x, int y)
{
int z;
x=65;
z=x+y;
return(z);
}
void "call-by-adderss" (int*m,int*n,int*q,int*r)
{
int p;
*m=65;
p=*m;
*m=*n;
*n=*p;
*q=*m+*n;
*r=*m**n;
}
No comments:
Post a Comment