Empleador activo
Write pseudo code to print out the Fibonacci sequence.
Anónimo
Hello, Can you please help me give more details of the interview please. It will be a lot helpful for me. Thanks alot in advance. Swetha
#include using namespace std; int main() { int n, c, next; int first = 1; int second = 1; cout > n; if ((n == 1) || (n == 2)) { if (n == 1) cout << "1" << endl; if (n == 2) cout << "1 1" << endl; } else { cout << "1 1 "; for (c = 3; c <= n; c++) { next = first + second; cout << next << " "; first = second; second = next; } cout << endl; } return 0; }
Sigue a tus empresas favoritas para estar al tanto de las últimas oportunidades y disponer de información desde adentro.
Recibe recomendaciones y actualizaciones personalizadas al iniciar tu búsqueda.