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 |
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
What is d'n in c?
c program to add and delete an element from circular queue using array
write aprogram for There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.
1 Answers iGate, Shashi, Source Bits, Subex,
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
main is a predefined or user define function if user defined why? if predefined whay?
List the variables are used for writing doubly linked list program.
what is use of loop?
There seem to be a few missing operators ..
if a person is buying coconuts of Rs10,and then sell that coconuts of Rs9,with the loss of one rupee.After that the person became a millaniore.how?
What is extern variable in c with example?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above