Not Yet Answered # Need Help

ahluka Discussion Starter breal iamthwee 1,547 iamthwee 1,547 ahluka iamthwee 1,547 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 ...

0

How much of the language do you know?

You need to find some tutorials - google around or buy some books, or goto www.cprogramming.com

Not sure what DaniWebs homework policy is since I've only just become a member myself, but where I usually moan and groan (cboard), we don't do it for you.

0

tht wuz not answer to my question.......btw wot do u mean by "we dont do it for u" ???

i have written that using "for loop"

0

Binet's formula:

[tex]Fib(n)=\frac{\phi^n-(-\phi)^n}{\sqrt{5}}[/tex]

Where [tex]\phi[/tex] is equal to:

[tex]\frac{1+\sqrt{5}}{2}[/tex]

Hope this helps :-)

0

thank you so much but tht wuz not helpful for me.....

Of course it is, if you are using fast fourier transforms to approximate the power functions and a library that supports arbitary floating point precision it will be perfect for you.

:-)

0

tht wuz not answer to my question.......btw wot do u mean by "we dont do it for u" ???

i have written that using "for loop"

Well post up what you've got so far so we can help you.

0

hello I found this I hope this helps

#include<stdio.h>

#define SIZE_NUM 100000000

#define VECTOR_DIM 500//max fib(10000)

#define display_arr(vec)for(i=indfin-1; i>-1; i--){temp=SIZE_NUM/10;if(i!=indfin-1)while(1){if(vec*/temp) break;putchar('0');temp/=10;}printf("%d", vec );}*

int main()

{int i=-1, opt;int indfin=1, ref=1;

unsigned int n0[VECTOR_DIM] = {0}, n1[VECTOR_DIM] = {1};

unsigned int temp;printf("Enter fib(n)");

scanf("%d", &opt);if(!opt)

printf("The Fibonacci number for 0 is 0");else{

while(i++<opt){indfin=0;

if(ref){while(temp = n0[indfin] + n1[indfin]){

n0[indfin] = temp%SIZE_NUM;n0[indfin+1] = temp/SIZE_NUM + n0[indfin+1];

indfin++;}ref=0;}else{while(temp = n0[indfin] + n1[indfin]){

n1[indfin] = temp%SIZE_NUM;n1[indfin+1] = temp/SIZE_NUM + n1[indfin+1];

indfin++;}ref=1;}}printf("The Fibonacci number for %d is \n ", opt);

if(ref) display_arr(n0)

else display_arr(n1)}putchar('\n');getchar();getchar();return 0;}

btw my binets formula was wrong... the minus phi needs to be raised to the minus n. tee he he

[edit] I've indented and highlighted keywords to aid clarity, in case you decide to submit as your own work[/edit]

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

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 :

code for the listbox - datagridview interaction

At the top of the code ...

the function that I created to find the ...