old is gold computer programming in C Grade Xii- 2076|Qn 1

old is gold computer programming in C Grade Xii- 2076|Qn 1

 

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





 

 

Post a Comment

0 Comments