Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- It gives the Fibonacci sequence until the term chosen by the user.
- */
- #include <stdio.h>
- int main()
- {
- int x = 0, y = 1, z, w;
- printf("Enter z: ");
- scanf("%d", &z);
- while(z > 0){
- printf("%d\n", x);
- w = y;
- y = x + y;
- x = w;
- z = z - 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement