fibonacci

I have been trying to iron out these three errors for a while now and i am sure its something simple if someone could help me out with would be amazing


1>c:\users\andrew\desktop\hw3\hw3\andrewwells_a_3.cpp(70): error C2144: syntax error : 'int' should be preceded by ')'
1>c:\users\andrew\desktop\hw3\hw3\andrewwells_a_3.cpp(70): error C2660: 'fibonacci' : function does not take 0 arguments
1>c:\users\andrew\desktop\hw3\hw3\andrewwells_a_3.cpp(70): error C2059: syntax error : ')'


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>

 
using namespace std;
//int integerPower;
bool isOdd( int integer )
{

  if ( integer % 2== 0 )
     return true;
  else
     return false;
	
  
	


  cout << "Please enter an integer"

		<< endl;
  cin >> integer;



     if(isOdd(integer) == true)
         cout << integer << "is odd." << endl;
     else
         cout << integer << "is even." << endl;

 

}

/*fibonnacci() function calculates fibonacci numbers*/
int fibonacci(int num)
{
if (num <= 1) return 0; 
if (num == 2) return 1; 
int num1 = 0;
int num2 = 1;
int num3;
for (int i = 3; i <= num; i++)
{
num3 = num1 + num2;
num1 = num2;
num2 = num3;
}
return num3;
}
 int intergerPower()
 {
int c, intergerPower();

for (int a = 1; a < 10; a++)
{
for (int b = 1; b < 4; b++)
{
	intergerPower();
cout << a << "^" << b << " = " << c << endl;
}
}
return 0;
 }
 int even();
int main()
{
	
	bool isOdd(int integer);
	intergerPower();
	fibonacci(int num);
 return 0;
}



	
I put a int before the fibonacci on line 70 and removed the parameters and it says build successful but then the program crashes as soon as its ran without letting me enter anything.. I have also tried running each program individually and it keep crashing no matter what i try.
Last edited on
Topic archived. No new replies allowed.