PROGRAM TO SHOW CALL BY VALUE

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

Leave a Reply

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