61 lines
728 B
Markdown
61 lines
728 B
Markdown
---
|
|
author: Julia Spriggs
|
|
date: 15 Octobre 2024
|
|
institution: Wild Code School
|
|
subtitle: Documenting Stuff
|
|
title: My Title
|
|
|
|
geometry:
|
|
- top=2cm
|
|
- bottom=2cm
|
|
- left=2cm
|
|
- right=2cm
|
|
numbersections: true
|
|
secnumdepth: 2
|
|
---
|
|
|
|
\newpage
|
|
|
|
# lol
|
|
|
|
## test
|
|
|
|
list:
|
|
|
|
* one
|
|
* subone
|
|
* two
|
|
|
|
---
|
|
|
|
```js
|
|
// program to find the sum of natural numbers using recursion
|
|
|
|
function sum(num) {
|
|
if(num > 0) {
|
|
return num + sum(num - 1);
|
|
}
|
|
else {
|
|
return num;
|
|
}
|
|
}
|
|
|
|
// take input from the user
|
|
const number = parseInt(prompt('Enter a positive integer: '));
|
|
|
|
const result = sum(number);
|
|
|
|
// display the result
|
|
console.log(`The sum is ${result}`);
|
|
```
|
|
|
|
\newpage
|
|
|
|
## follow
|
|
|
|
new bla
|
|
|
|
image:
|
|
|
|
![A mountain](image.png)
|
|
|