Afficher un message
Vieux 18/10/2007, 12h03   #4
Nick Keighley
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Need i need a programmer

On 18 Oct, 10:56, zohaib.shir...@gmail.com wrote:

> i have got a quizz to [...]


the idea of a "quiz" is for *you* to do the work


> write a programm that gives the sum of all even
> numbers between two variables x and y and then displays the sum.
> Include both x and y in the total sum.
>
> Any one here can me............ ?


in NAPSIC (Nick's All Purpose Symbolic Instruction Code)

DEFINE print_sum_evens (INTEGER x, y)
INTEGER sum <- 0;

FOR ALL i IN RANGE (x, y)
IF is_even (i)
sum <- sum + i
END
END

PRINT sum
END


--
Nick Keighley

  Réponse avec citation
 
Page generated in 0,04312 seconds with 9 queries