473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can anyone help me please ?? URGENT

Hi;

I have two problems and I need your help with the code. below is the question.

1- write a recursive function powe ( base, exponent ) that, when invoked , returns base ^ exponent = base . base ^ exponent - 1

for example , power (3,4) = 3 * 3 * 3 * 3. Assume that exponent is an integer greater than otr equal to 1 . Hint the recursion step would use the relationship

base ^ exponent = base . base ^ exponent-1

and the remaining condition occurs when exponent is equal to 1, because.

base^1 = base.

-----------------------------------------------------------------------------


the second one is :

1- write a nonrecursive function fibonacci ( n ) that calculate the nth fibonacci number.

2- determine the largest int fibonacci number that can be printed on your system. modify the program # 1 to use double instead of int to calculate and return fibonacci numbers, and use this modified program repeat part 2.


thanks in advance.
Sep 23 '06 #1
1 1771
D_C
293 100+
These are both simple tasks. Have at it, and if you need any help, we'll be more than happy to help.
Sep 23 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Liu Ju | last post by:
Dear members: I want to use the multithread in my program which is developed in Visual C++ platform (version 6). I created a controlling function: UINT CCOMM1Dlg::WritingThreadFunc(LPVOID...
2
by: Bill Yin | last post by:
Please tell me where can download <Beginning C# web Applications with Visual studio .net> 's code Thanks in advance!
1
by: MR | last post by:
Hi, it has been observed that when we try to instantiate a .Net dll for the first time in a session (e.g. from an exe in .Net), it takes almost 10 times compared to subsequent instantiations. ...
0
by: bprasanth_20 | last post by:
Hi, I need an urgent help. I need to create a UDF (User Defined Function) in DB2 SQL which can accept any number of arguments (from 2 to 5 arguments). I do not how to achieve this. When I pass 2...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
5
by: uanmi | last post by:
There is a patch to upgrade UAB2 to dotnet 2 on gotdotnet But, as normal, there are no instructions on what to do to patch the Microsoft UAB 2 install. Can Microsoft please upgrade their UAB2...
8
by: John Austin | last post by:
I need to understand why if I add a control and use AddHandler to connect its click event, it will work in Page_Load, but not in a Button_Click. The idea is that the user types some data, presses...
4
by: Stacey Levine | last post by:
I am trying to develop an intranet site and thought I would use Master Pages and themes. I found the the MS templates at http://msdn2.microsoft.com/en-us/asp.net/aa336613.aspx and was trying to...
2
by: itsvineeth209 | last post by:
My task is to create login control without using login control in tools. I shouldnt use sqldatasource or any other. I should use only data sets, data adapters and data readers etc. U had created...
1
by: maheshgupta0248 | last post by:
Hi everyone.. Im newbie in the driver development.. till now i have developed some drivers in Linux. Now I have to change to Windows.. can anyone tell me what are the real differences between driver...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.