Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int variable1 = 1;
- int variable2 = 1;
- int i = 2;
- int fin = 0;
- printf("Quelle occurence recherchez vous ?");
- scanf("%d", &fin);
- while(i<fin)
- {
- variable1 = variable1 + variable2;
- i++;
- variable2 = variable1 + variable2;
- i++;
- }
- if(fin%2==0)
- {
- printf("La %d eme occurence est : %d", fin, variable2);
- }
- else
- {
- printf("La %d eme occurence est : %d", fin, variable1);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement