coding for Fibonacci.?
Answer / siggi
class hcl
{
public static void main(String arg[])
{int a=0;
int b=1;
int i=1;
int x,y;
/*System.out.println("enter the no.");*/
x=Integer.parseInt(arg[0]);
if(x==0 || x==1)
{ System.out.println("yes it is");}
else {
do
{
y=a+b;
if(x==y)
{ System.out.println("yes it is");
i=0;}
else if(x>y)
{a=b;
b=y;}
else
{ i=0;
System.out.println("no it is not");}
}while(i!=0);
}
}
}
Is This Answer Correct ? | 1 Yes | 3 No |
c program to subtract between two numbers without using '-' sign and subtract function.
What is I ++ in c programming?
what is answer for perfect number????????????????
write c program to display output 10(10+20)+(10+20+30)+ ... n term
0 Answers Hindustan Gum Chemicals,
Why c++ is called c++ and not c+?
Why do some versions of toupper act strangely if given an upper-case letter?
What does nil mean in c?
What are c identifiers?
mplementation of stack using any programing language
Describe explain how arrays can be passed to a user defined function
Difference between malloc() and calloc() function?
How to explain the final year project as a fresher please answer with sample project