Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Great Beginner
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Franck <franck.collineau@f...>
Subject: [Caml-list] Great Beginner
Hi!

I want to calculate the sum of the n first numbers.
I've written this code:
let x =0;;
let somme n =
        for i=1 to n
                do
                  x=x+i
                done;;

It doesn't work.
Why ?

Thanks

Franck

-- 
___________________________________
Franck Collineau
FTR&D DMI/TAM/TIL
4 rue du Clos Courtel
B.P. 59
35512 Cesson Sévigné Cedex
tél: 02 99 12 43 97
franck.collineau@francetelecom.com
___________________________________
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr