Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
add F# program to print numbers (#5699)
Browse files Browse the repository at this point in the history
Co-authored-by: rleontiev <[email protected]>
Co-authored-by: Yuri Cunha <[email protected]>
  • Loading branch information
3 people authored May 13, 2024
1 parent 48584ed commit ae8de22
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Write a F# program to print numbers from n to 1 without using a loop

// Input : 5
// Output : 5 4 3 2 1

let mutable num = 5;

let rec printNumbers i =
if i > 0 then
printf "%d " i
printNumbers (i - 1)

printNumbers num

0 comments on commit ae8de22

Please sign in to comment.