int main()
{
double a, b=0.45, c;
printf("Enter the weight in Pound: ");
scanf("%d", &a);
c=(a,b);
printf("The weight in KG is %lf",c);
}
double mul(double a, double b)
{
return(a*b);
}
When I put any number in there. The result is still 0.45
How come it could be that?
a. main function
i. Asks the user for someone’s weight in pounds
ii. calls a function that takes the weight and returns its equivalent in Kilograms
iii. Display the weight
b. pound convertor
i. takes the weight in pounds and converts it to kilogram
ii. returns the weight in kilograms
This is the reason why I'm making a multiply function
You don't understand, if it simply multiplies two numbers it's completely unnecessary. Just use * however if it actually serves some functionality you may want to consider a name change.