One method you can use is to start off with 2 integers that store the beginning of the Fibonacci sequence and loop through to modify them and iterate through the sequence. If one of the values exceeds the number you are checking, you passed it, so you know it's not a fib number. If you hit the number, then it is a fib number.

Jwenting allready did that ...
just google 'fibonnaci' and program it.
don't just assume making your assignments is the biggest thrill or honour we're hoping to achieve here

int k
int l;
System.out.println("Enter an integer :");
num=reader.nextInt();
for (l=2;l < k ;l++ ){
int y = k%l;
if (y==0){
System.out.println(k+"is not a fibonacci");
break;
}
}
if(l== k){
System.out.println(k+"is a fibonacci ");

but i dont know what is the problem

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Compile it, run it, play around with it, etc. If you get a syntax error tell us the line and we will help you. If you get a bug specify what the code is doing wrong. If the code is simply "not working" as in your algorithm is completely wrong because your answers are totally off, then try rewriting the algorithm (we aren't helping with that part).

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...