Answer:
#include <iostream>
using namespace std;
int main()
{
cout << "Enter number: ";
int number;
cin >> number;
int prevfib = 0;
int fib = 1;
while (fib <= number) {
cout << fib << " ";
int add = prevfib;
prevfib = fib;
fib += add;
}
3.4m questions
4.4m answers