reset password
Author Message
303627966
Posts: 11
Posted 00:12 May 06, 2016 |

how do i get the product of all even numbers in one step? my code displays them but it prints out different statements for each even number

kknaur
Posts: 540
Posted 09:37 May 06, 2016 |

Can you please post what your output looks like? I cannot follow your question.

303627966
Posts: 11
Posted 18:06 May 06, 2016 |

here is my code so far 

Edit: Please do not post code on CSNS.  If you want me to look at it, email it to me.

Last edited by kknaur at 18:21 May 06, 2016.
303627966
Posts: 11
Posted 18:10 May 06, 2016 |

heres a screen shot 

 

kknaur
Posts: 540
Posted 18:22 May 06, 2016 |
303627966 wrote:

heres a screen shot 

 

On hint I will give you is that if something is in the loop it will repeat.  If you only want to print the result at the end, then the print statement should not be in the loop.

303627966
Posts: 11
Posted 18:26 May 06, 2016 |

oh okay no wonder. thank you 

michaelkou
Posts: 7
Posted 01:58 May 07, 2016 |

If the product of all even number between 7 and 25 is 4.08748032E10. Will that be the same as 40874803200.

kknaur
Posts: 540
Posted 11:12 May 07, 2016 |
michaelkou wrote:

If the product of all even number between 7 and 25 is 4.08748032E10. Will that be the same as 40874803200.

Your output should be exactly like mine, i.e. mine was not in scientific notation.