Re: help plz



In article
<13701002.1142436257273.JavaMail.jakarta@xxxxxxxxxxxxxxxxxxxxxx>, Jabran
Zahid <jabranzahid@xxxxxxxxx> wrote:

hi
i m writing a code for the number of red balls in a triangle on a
snooker table.

The program should work as follows:
user will input the depth of triangle e.g 5 so the program should
calculate it as 5+4+3+2+1 = 15
or depth = 4 then 4+3+2+1 = 10 and so on....

can anyone plz help me in writing this program ?

thaNKS
-----------------
There is a story told about the famous mathematician, Carl Friedrich
Gauss, when he was ten years old. His school instructor gave his class
the problem of adding up all the numbers from 1 to 100 to keep them busy
for a while. Instead of doing all the hard work of adding these numbers,
little Gauss thought of how he could conceptually reverse the order of the
last 50 and place them under the first 50:

1 + 2 + 3 + ... + 50 +
100 + 99 + 98 + ... + 51

so as to get 50 pairs, each with a sum of 101, so he had only to multiply
50 x 101 to get 5050.

(Remove "xyzzy" and ".invalid" to send me email.)
Roger Stafford
.



Relevant Pages

  • Re: number of red balls in a triangle
    ... snooker table. ... user will input the depth of triangle e.g 5 so the program should ... can anyone plz help me in writing this program? ... function depth = calculate_depth ...
    (comp.soft-sys.matlab)
  • help plz
    ... i m writing a code for the number of red balls in a triangle on a snooker table. ...
    (comp.soft-sys.matlab)
  • number of red balls in a triangle
    ... i m writing a code for the number of red balls in a triangle on a snooker table. ...
    (comp.soft-sys.matlab)
  • Early writing?
    ... And it seems to suggest that the triangle -- ... in the writing system, ... I'd have to say that it's the bread cone. ...
    (sci.archaeology)
  • Re: Geometry
    ... that spent quite a few years in some of Gauss' ... drawers before he published it, works for higher dimensions as well. ... the vector from a base point to a vertex on triangle on the mesh, ...
    (borland.public.delphi.thirdpartytools.general)