Naikon
12-05-2007, 01:50 AM
Hi, I have a small simple problem and I would greatly appreciate assistance.
I have printed a simple table using a loop as follows:
Base Exponent Result //result=base raised to exponent//
2 0 1
2 1 1
2 2 1
2 3 1
2 4 16
Basically, I want a user to enter a base and min and max exponents, and without using pow() function, calculate each base raised to the exponent given a max and min exponent.
Sorry, my code is really, really bad I am a complete noob.
I just want to learn programming but this is an issue for me:(
How do I get the output such that the base is raised to each exponent in the range for each iteration?
Thanks.
for(i=min; i <= max; i++)
{
answer = 1;
for(min=min; min <= max; min++)
{
answer = max*min;
}
I have printed a simple table using a loop as follows:
Base Exponent Result //result=base raised to exponent//
2 0 1
2 1 1
2 2 1
2 3 1
2 4 16
Basically, I want a user to enter a base and min and max exponents, and without using pow() function, calculate each base raised to the exponent given a max and min exponent.
Sorry, my code is really, really bad I am a complete noob.
I just want to learn programming but this is an issue for me:(
How do I get the output such that the base is raised to each exponent in the range for each iteration?
Thanks.
for(i=min; i <= max; i++)
{
answer = 1;
for(min=min; min <= max; min++)
{
answer = max*min;
}