Problem, can anyone help. - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Problem, can anyone help.

Posts: 40Member
I have written a program to calculate an electricity bill as part of my college assignment and I've just found a problem that I am unable to solve.

The calculations I have done in the program are correct, but when I display the results of calculations involving high numbers (over 1000), they appear incorrectly and I do not understand why. Can anyone tell me how to solve this?

• Posts: 117Member
: I have written a program to calculate an electricity bill as part of my college assignment and I've just found a problem that I am unable to solve.
:
: The calculations I have done in the program are correct, but when I display the results of calculations involving high numbers (over 1000), they appear incorrectly and I do not understand why. Can anyone tell me how to solve this?
:
are you using integer? try using longint; or word; this will give you bigger number abilaty! if not then post some of your code so that we can see where u are going wrong!

sweeney
• Posts: 40Member
Well the output I want is in real format. I've tried using double but it doesn't work either. The calculations I have done are correct and work fine on numbers under 1000.
• Posts: 117Member
: Well the output I want is in real format. I've tried using double but it doesn't work either. The calculations I have done are correct and work fine on numbers under 1000.
:
nope its ok right do you know decamal places you need to do it in this case! ok give me the output line and I will fix it!
• Posts: 117Member
: : Well the output I want is in real format. I've tried using double but it doesn't work either. The calculations I have done are correct and work fine on numbers under 1000.
: :
: nope its ok right do you know decamal places you need to do it in this case! ok give me the output line and I will fix it!
:
see real is decamal numbers! so here is an example

[code]
program example;
uses crt;

begin
write(' Enter the price of the product: ');