C Program – Print the number which are not occurred in Fibonacci Series

by Nideesh C on May 9, 2011 · 0 comments

in C Programming




//Downloaded From theonlinetutorials.com
#include<stdio.h>
int fib(int n)
 {
 if(n==1)
 return 0;
 if(n==2)
 return 1;
 else
 return fib(n-2)+fib(n-1);
 }
int main()
 {
 int n,on=0,nn,cou,i;
 printf("Enter the no to which you want to print all no which did not occur in fib series");
 scanf("%d",&n);
 cou=1;
 printf("\nNumber which are not occured in the series are\n");
 while((nn=fib(cou))<=n)
 {
 cou++;
 for(i=on+1;i<nn;i++)
 printf("%d ",i);
 on=nn;
 }
 return 0;
 }



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Fibonacci numbers
  2. C program to find the value of sin(x) using the series up to the given accuracy (without using user defined function) Also print sin(x) using library function.
  3. C program to find the value of cos(x) using the series up to the given accuracy (without using user defined function) Also print cos(x) using library function.
  4. C program to generate and print first N FIBONACCI numbers
  5. C Program To find the fibonacci numbers below a given number.

Leave a Comment

Previous post:

Next post: