PROGRAM TO SHOW CALL BY REFERENCE

/*PROGRAM TO SHOW CALL BY REFERENCE*/
#include<stdio.h>
#include<conio.h>
void arper(int *,int *,int,int);
void main()
{
int l,b,ar,per;
clrscr();
printf(“Enter length and breadth of rectangle: “);
scanf(“%d%d”,&l,&b);
arper(&ar,&per,l,b);
printf(“Area of rectangle is: %d\n”,ar);
printf(“Perimeter of rectangle is: %d”,per);
getch();
}
void arper(int *ar, int *per,int l, int b)
{
*ar=(l*b);
*per=2*(l+b);
}

Leave a Reply

Your email address will not be published. Required fields are marked *