Page

C Program to evaluate the expression s=sqr(a()+b())

#include<stdio.h>
#include<conio.h>
#include<math.h>
 void main()
{
int s=0,a(),b(),sqr(int);
s=sqr(a()+b());
printf("\n square of sum=%d",s);
getch();
}

a()
{
int a;
printf("\n enter value of a;");
scanf("%d",&a);
return(a);
}

b()
{
int b;
printf("\n enter value of b;");
scanf("%d",&b);
return(b);
}

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

No comments:

Post a Comment