[My site ]
Main » 2013 » December » 13 » 2007-2008 question 4
0:15 AM
2007-2008 question 4
write a program to read the value of two integers and calculate the sum of squares of these numbers the program should use three function
1- sum of two num
2- square of value
3- sum of squares of two num

#include"stdio.h"
int sum(int a, int b);
int sq(int c);
int sumsq(int d, int e);
main()
{
int x, y;
printf("enter two numbers : ");
scanf("%d%d", &x, &y);
printf("the sum of squares of the two numbers is %d", sumsq(x,y));
getch();
return 0;
}
int sum(int a, int b){
int sum=a+b;
return sum;
}
int sq(int c){
int square=c*c;
return square;
}
int sumsq(int d, int e){
int sumofsq=sum(sq(d),sq(e));
return sumofsq;
}
Category: C Programming - 1 | Views: 440 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]