Mode:
Duration:
1
2
3
4
5
6
7
8
import std.stdio;
int fib(int n) {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}
void main() {
foreach(i; 0 .. 10)
writeln(fib(i));
}Coding works best on desktop or with an external keyboard.
import std.stdio;
int fib(int n) {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}
void main() {
foreach(i; 0 .. 10)
writeln(fib(i));
}Coding works best on desktop or with an external keyboard.
Generates first 10 Fibonacci numbers.
import std.stdio;
int fib(int n) {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}
void main() {
foreach(i; 0 .. 10)
writeln(fib(i));
}D is a high-level, statically typed, compiled systems programming language combining C-like performance with modern features like garbage collection, functional programming, and meta-programming.
Origin & Creator
Created by Walter Bright in 1999, later developed with contributions from Andrei Alexandrescu.
Industrial Note
D is used in performance-critical applications, game engines, high-performance computing, and financial software requiring fast, reliable code.