salut..i am trying to make a program in order to calculate the y^2=a^2+b^2 and the code is:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
double ypotinousa(double a, double b); /* function prototype*/
int main(int argc, char *argv[]) /*program begins*/
{
double a,b,y,result;
printf("Give the first number:\n");
scanf("%d",&a);
printf("Give the second number:\n");
scanf("%d",&b);
printf("The result is:%d\n",ypotinousa(a,b));
system("PAUSE");
return 0;
}
double ypotinousa(double a, double b)
{
double y;
y=pow(a,2)+pow(b,2);
return sqrt(y);
}
This program is always return me zero after running..what is wrong? (i guess the function type..)