Last active
August 12, 2017 20:15
-
-
Save condef5/9fbfe2c4b6f33046593723a79f059d07 to your computer and use it in GitHub Desktop.
Serie de snipets para alumnos del 1 ciclo de la Unas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
#include <conio.h> | |
void main(void) | |
{ | |
// Serie de tipo => -1 1 0 1 1 2 3 5 | |
int a =-1 ,b = 1, c, numTer; | |
cout<<"Ingrese el numero de terminos"; | |
cin>>numTer; | |
for(int i = 0; i < numTer; i++){ | |
c = a + b; | |
a = b; | |
b = c; | |
cout<<c<<"\t"; | |
} | |
getch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment