I am currently experiencing some difficulty when it comes to simple athrimitics in C. I am using variables that are double, so should be able to handle decimal, multiplying them and/or dividing them by another variable, also a double, and when I go to display the result using for example
Code:
`printf("%d", bla)`
I get a return of 0 instead of the number I am suppose to get. This happens is several places in my program and I can't figure out why, in some of the arithmitics I am using hex. values (ex. 0xA) but I don't see why that should make a difference.

If you can offer me any advice it would be greatly appreciated

Thanks

2. Use %f for floating point numbers. %d is for integers.

Quzah.

3. Ok that is well and good, and I can't believe I didn't think of that, but I'm still stuck with one problem. I am receiving data from an data acquisition board, which returns the data to me in hex. I then need to do some calculation to that value, which I am doing in hex. then show it in decimal. So far when I do my calculations all I do get is 0 as an answer. Below is a segment of the code being used
Code:
```finalResult = (datavalue/calcValue)*calcValue1;
fprintf(outOpen,"    %f",finalResult);```
where datavalue is the value recieved from the board in hex. calcValue is 0x1000 and calcValue1 is 0x14.

When I get a value like 2 from the board I should still be recieving a final value print out of something like 0.002 but I am getting 0. Same with bigger numbers like 153 as a returned value from the board.

If you can give me any advice, once again it would be greatly apprieciated

Thanks

4. You're doing all integer math, which will truncate your division to 0. Cast the values to float on the right side of your equal