1. Program to generate the Fibonacci sequence.
#include <iostream.h>
#include<conio.h>
int main() {
int n, t1 = 0, t2 = 1, nextTerm = 0;
cout << "Enter the number of terms: ";
cin >> n;
cout << "Fibonacci Series: ";
for (int i = 1; i <= n; ++i) {
cout << t1 << " ";
nextTerm = t1 + t2;
t1 = t2;
t2 = nextTerm;
}
getch();
return 0;
}