![]() | ![]() | ![]() |
| |||||||
| 8051/8951 A specify forum for the Intel 8051/8951 single chip microcontroller. |
![]() |
| | Tools |
| | #1 |
|
I m having trouble with keil for 89c51. I want to find out factorial of a no. On keil. No are from 0-9. When the answer is greater than 255 we need to split the term in 2 memory locations but i dont know how it can be done.can anyone help me plz....
| |
| |
| | #2 |
|
Since your numbers are from 0-9, the factorial result can go up to 362880 (factorial of 9), which I think will require more than 2 memory locations. One way is to store individual digits (ones, tens, hundreds, ...) to different locations. You can do that by dividing by 10 and saving the reminder. - Raj Experiments with PIC16F628A | |
| |
|
| Tags |
| factorial, keil, program, trouble |
| Thread Tools | |
| Display Modes | |
| |