-
Function exercise
Hi everyone can anyone help me with this little problem... :o
Write a program that requests two floating-point numbers and prints the value of their difference divided by their product.
I do not understand what is ment by getting their difference or how to get it, can anyone please help me out with a little example(the calculation), please...
-
im not to sure what you mean but as for dividing the 2 numbers here is an example
Code:
#include <stdio.h>
#include <conio.h>
int main(void)
{
float num1 , num2;
printf("Enter 2 Numbers : ");
scanf("%f %f" , &num1 , &num2);
printf("%.2f Divided by %.2f is %.2f\n" , num1 , num2 , num1 / num2);
system("pause");
return 0;
}
[edited]
also because they are floats it will have the remainder.
[/edited]
-
difference is the values subtracted from each other
difference between 1 and 5 is 4 (ie 5-1);
so subract the values save the result as difference;
multiply the values save the result as product;
then take difference/product;
-
-
Do NOT request people do your homework for you. Read the Announcements. But as they say, it's too late now. Congradulations, you'll go far in life if you can get everyone to do everything for you all the time.
Quzah.
-
Surprised you don't know what 'difference' means, if you're at a grade level in which there's comp sci... :rolleyes:
-
I was confused about why it is I need to divide the difference by the product and what this would achieve, obviosly it was just an exercise and the output of the program was nothing but an argument passed to a function...