In this tutorial, we are going to write a C program to evaluate the equation s=sqr(a()+b()) using function in C Programming with practical program code and step-by-step full complete explanation.

C program to evaluate the function equation


C program to evaluate the function equation.

 
#include<stdio.h>
#include<conio.h>

void main()
{
    int s=0,a(),b(),sqr(int);
    clrscr();

    s=sqr(a()+b());

    printf("Square of sum=%d",s);

}

int a()
{
    int a;

    printf("Enter value of a:");
    scanf("%d",&a);

    return(a);
}
int b()
{
    int b;
    printf("Enter value of b:");
    scanf("%d",&b);

    return(b);
}

int sqr(int x)
{
    return(x*x);
}


Output

 
Enter value of a: 5
Enter value of b: 3
Square of sum = 64