Not really. You need a base case for the recursion which is going to occur. The specializations for those values 1 and 2 are such cases.
Type: Posts; User: whiteflags
Not really. You need a base case for the recursion which is going to occur. The specializations for those values 1 and 2 are such cases.
Apparently.
He seemed to post the same thing over and over until someone did it for him, no matter what anyone said.
And frankly, I am a bastard, so you'll have to deal with that.
Then I will just point out that you seem content to do his homework for him, which is all you are doing now.
And as far as what is being taught in school, how do you know? Is it not one of your...
I will repeat it: return(0); is a standards compliant statement. Do you really want to argue that?
Really? Well like I said before, you need parens in many cases where you opt to remove whitespace...
You said "wherever I want to use it," well: "Proper" is bull......... What if I wanted to use it for an obfuscated code contest? Is it not proper there, as well as far as the standard is concerned?...
Then the teachers are wrong, and so are you.
Does
int main()
{
return(0);
}
How are you posting without code tags, anytime?
#include <iostream>
using namespace std;
int main (int argc, char* argv[])
{
int fib1 = 0;
int fib2 = 1;
It doesn't matter if you think that is true, it is a fact.
"return0" would not be correct like "return(0)" or "return 0" is. Thus, parentheses for grouping is not illegal in C++. There is no harm...
Actually you would NEED use parentheses any time you needed to distinguish between keywords, such as return, and a token, such as 0, without resorting to white space too, ~Kyo~. It's not strange or...
Why is your second attempt so much worse than the first one? You were a lot closer before: you only didn't understand how to write a for loop. If you're reading the thread at all, you should have a...
OK, let's just assume you knew how to calculate fibonacci numbers by hand. How many numbers would you have to calculate before you get to the 6th term? How about the 12,047th? You have to count n...