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.
1 1790 D_C 293
Contributor
These are both simple tasks. Have at it, and if you need any help, we'll be more than happy to help.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 pParam) for a thread
The reason that I want it to belong to the class CCOMM1Dlg is that in
this function I need to process some member variables of the class.
|
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!
|
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.
We have A.exe, developed in VB.Net, where, in a button
click, we are instantiating the Test.dll also developed in
VB.Net. We run three instances of A.exe simultaneously
(say A1, A2 and A3 are the three instances). Clicking on
|
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 arguments to the function (please note that it is not a procedure), it should return one value, if u pass 3 arguments, it should give another value and so on until 5 arguments. If any of you know about such a method, please help me in solving this...
|
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 the socket is missing the
last character (line feed). When the same text is sent without the urgent
flag set, all of the characters are read.
I'm reading the data using the blocking read call of the network stream
class. The .NET...
| |
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 installer to support dotnet 2 now.
I really need help urgently as I am completely lost due to the changes that
I'm expected to use a crystal ball to understand.
|
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 the button, gets a list
of results (each with a LinkButton) and can then press one of the link
buttons to get further information. The newly added link buttons appear, but
the click event added with AddHandler does not fire.
A control added in...
|
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 set
everything up. I created a Master page with three containers:
header, content, footer. I created another page and put a few things in the
content container. I set the theme option in the web.config. It appears to
be applying the theme to the...
|
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 table login with fields username(varchar(50)), password(varchar(50)), firstname(varchar(50)), lastname(varchar(50)).
U had to display username , first name, last name in default.aspx page after login.
One more condition is that, if user fails login...
|
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 development in other versions of windows and Windows Vista..
What are the advantages of driver development in Windows Vista.. I have googled but came without any information.. Can anyone help me it is very urgent..
Also if possible please tell...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |