$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 age = 25;
age = 26; // Allowed
console.log(age); // 26- Used for variables whose value should not change.
- 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!