Home

A program to explain FUNCTION PROTOTYPE

C Programming Language 074

Program

#include <stdio.h>

int area(int, int);

void main()
{
    int l, b, ar;
    printf("Enter l, b: ");
    scanf("%d %d", &l, &b);
    ar = area(l, b);
    printf("Area = %d", ar);

    printf("\n");
}

int area(int p, int q)
{
    int a;
    a = p * q;
    return a;
}

Result

Enter l, b: 2 3
Area = 6


Last Updated on

Next Post: Rules vs Guidelines →

Comments