Question 62 : Write a program in Java to find and print the non-fibonacci numbers up to a limit entered by the user.
Java Program :
class non_fibonacci
{
static void check(int n)
{
int a=2,b=3,i,j;
System.out.print("The non-fibonacci numbers are : ");
loop1: for(;;)
{
i=a+b;
for(j=b+1;j<i;j++)
{
if(j>n)
break loop1;
System.out.print(j+" ");
}
a=b;
b=i;
}
}
}
Java Program :
class non_fibonacci
{
static void check(int n)
{
int a=2,b=3,i,j;
System.out.print("The non-fibonacci numbers are : ");
loop1: for(;;)
{
i=a+b;
for(j=b+1;j<i;j++)
{
if(j>n)
break loop1;
System.out.print(j+" ");
}
a=b;
b=i;
}
}
}
That's a modified share button. Upgraded one.
ReplyDeleteI didn't get you
Deletethanks 4 d program
ReplyDeleteJUSR THE PERFECT ONE REQUIRED
ReplyDeleteIt's not perfect one main class is missing
DeleteMAin method missing in above program.kindly provide the correct one.
ReplyDeleteNot properly described
ReplyDeleteGive an input example and output
ReplyDeleteDo it easily... We can't get u
ReplyDelete