Q.) Write a C program to Fibonacci numbers less than given user number.
#include<stdio.h>
#include<conio.h>
int main( )
{
int x, y, z, num ;
printf("Enter any last Number of FIBONACCI series : ") ;
scanf("%d", &num) ;
x=0;
y=1;
while(num>=x)
{
z=x+y ;
printf("%d\t", x) ;
x=y ;
y=z ;
}
return 0 ;
}
:: OUTPUT OF ABOVE PROGRAM ::
Enter any last Number of FIBONACCI series : 60
No comments:
Post a Comment