## Re:Program Help

##### Quote

In article <45sjip$...@kdcol.kdcol.com>, bluem...@kdcol.com (Jeff Bluemel) writes:

>Hey guyes, I've got a program here I can't figure out. I will not

>calculate the sum after the first number.

>Help appreciated...

>Program 38;

>var Times, Number, OldNumber, Sum, Count : integer ;

>Const Zero = 0 ;

> {This program will add positive numbers in sequence that

>terminal

> with zero. The numbers must also be positive}

>begin

> OldNumber := 0 ;

> Number := 0 ;

> Count := 0 ;

> Sum := 0 ;

> Times := 0 ;

> writeln ;

> write ('Please enter how many number you have to enter = ') ;

> readln (Times) ;

> for Count := 1 to Times do begin

> write ('Please enter the value of the number = ') ;

> readln (Number) ;

> if (Number > OldNumber) and (10 mod Number = Zero) then

^^^^^^^^^^^^^^^^^^^

What is the purpose of this condition?

##### Quote

> Sum := Sum + Number ;

> OldNumber := Number ;

Why are we saving the previous number here?

##### Quote

> end; {for}

> writeln ('The sum of the numbers entered = ', Sum) ;

>end. {Program 38}

>Jeff Bluemel

>Private email prefered

>bluem...@kdcol.com or dsga...@prodigy.com

With certain data sets, these conditions will prevent the program from

seeing some of zero terminated numbers for summing, what data are you

using?

Email me a bit more info please.

Regards,

-* Stephen *-

Stephen Posey

University of New Orleans

Email : S...@uno.edu

WWW : http://www.uno.edu/~slp