Pergunta de entrevista da empresa American Airlines

Write pseudo code to print out the Fibonacci sequence.

Respostas da entrevista

Sigiloso

11 de nov. de 2014

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

3

Sigiloso

21 de out. de 2015

#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; }