$n = 10;
$a = 0;
$b = 1;
echo $a . ' ' . $b . ' ';
for ($i = 2; $i < $n; $i++) {
$c = $a + $b;
echo $c . ' ';
$a = $b;
$b = $c;
}Generate the Fibonacci series
Related Posts
More content you might like
Tutorial
javascript
Variables and Constants
{
let x = 10;
console.log(x); // 10
}
console.log(x); // Error: x is not defined- Variables are accessible within the entire function they are declared in.
- Example:
Dec 10, 2024
Read More Code
javascript
JavaScript Prime Number Check
No preview available for this content.
Jan 26, 2024
Read MoreDiscussion 0
Please sign in to join the discussion.
No comments yet. Be the first to share your thoughts!