What is user define function? Write a C program to input the length and breadth of a pond and find its area by using user define function
User define function
User define function:- These are functions that are defined by users at the time of writing a program. The user has the choice to choose its name, return type, arguments, and types. These functions need a function prototype to use.
Examples of user define function
Area(), evenodd(), si() etc
Write a C program to input length and breadth of a pond and find its area by using user define function
#include<stdio.h>
#include<conio.h>
void area(int,int);
void main()
{
int l, b;
printf("\n Enter length and breadth of a pond");
scanf("%d%d", &l, &b);
area(l, b);
getch();
}
void area(int l, int b)
{
int A;
A=l*b;
printf("\n Area of pond=%d", A);
}
Output


0 Comments
Please do not enter any spam link on comment box