Skip to main content

Checking whether a number is Fibonacci.

PROCEDURE:-
    1.enter an integer value
    2. set a=0,b=1,c=a+b,flag=0
    3.repeat steps 4 ,5 until c is less than or equal to n
    4.if n and c are same print that n is Fibonacci number
    5.else set a=b,b=c, c=a+b
    6 if n is not equal to c it is not Fibonacci number 
CODE:-

#include<stdio.h>
void main()
{
int n, a=0,b=1 ,c,flag=0;
printf(“enter a number”);
scanf(“%d”,&n);
do
{
    c=a+b;
    if(n= = c)
      {
        flag=1;
        break;
       }
     a=b;
     b=c;
  }while(c<=n);
if(flag = = 1)
printf(“%d is Fibonacci number”,n);
else
printf(“%d is not Fibonacci number”,n);
}


Input:-enter a number  8
Output:-8 is Fibonacci number

Comments

Popular posts from this blog

Future Mouse-Evo Mouse

New evolution of the Mouse. In 1980's round ball mouses are invented, then technology introduced Optical mouses. Now upcoming Mouse is named as Evo mouse . No more movement of your hands on placing a physical mouse,   Your finger is the pointer . You can use this mouse on any Flat Surface and also it requires very little space. This mouse contains a Power button on the top, Mini USb port . It works with the help of bluetooth and input is taken by the sensor. View this Video to know the functionality of   EvoMouse

Hide your IP address with Proxy servers

The most common method to Hide your IP address is to use a PROXY server. Proxy server is a computer network service that provides an indirect connections between other computer networks. By using this proxy sites we can access any website with out revealing our IP address. This is the best method to keep your IP address secure. Here is the free proxy server website link.  http://www.freeproxyserver.ca/     We need to type the URL of such as (www.facebook.com) in the box given in the site, then we can browse it with out providing our IP address

Password Protection to your USB to secure data

Here is a small application to protect your USB data by keeping a password. It is also useful to   " USB flash drives, thumb drives, memory sticks, external drives, and memory cards ."  With USB Secure, you will never have to worry again about lost or stolen USB/External drives. USB Secure offers multiple protection layers ensuring maximum security of your password-protected data on any portable medium. USB Secure secures your sensitive data against theft, accidental loss, and data leak. Independent USB Secure is fast, reliable, and PC independent, making it the most flexible and robust portable drive protection software in the market. USB Secure does not install any kernel or filter drives, taking away the hassle of requiring administrator rights to password protect portable devices. Protecting your sensitive data with USB Secure is a one-click process, requiring no lengthy installations. Access to your protected data on a portable drive is convenient too. ...