Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int function(int n){
- int prev = 0;
- int curr = 1;
- int next;
- int count = 2;
- do{
- next = prev+curr;
- prev = curr;
- curr = next;
- count = count + 1;
- }
- while(count <= n);
- return count;
- }
- int main(void) {
- printf("%d\n",function(1));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment