help with an error

Hi I am new to the c++ programming. I always get an error in line 18# that says : |18|error: expected primary-expression before 'int'|

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
#include <iostream>

using namespace std;

int intake_x();
int intake_y();
int calc(int x , int y);
void utkoma(int sum,int x,int y);

int main()
{
    int intak1;
    intak1 = intake_x();

    int intak2;
    intak2 = intake_y()

    utkoma(int sum,int x,int y);

    return 0;
}

int intake_x() {

    int x = 0;


 cout << "Base:";
 cin >> x ;


 return x;
 }

int intake_y(){
    int y = 0;

    cout << "Exponent:";
    cin >> y ;

    return y;
 }

int calc(int x ,int y){

    int sum;
    sum = x ^ y;

    return sum;
}

void utkoma(int x,int y,int sum ){

   cout << x << " to the power " << y << " = " << sum << endl;

   return;

}
Are you trying to call the utkoma function on line 18? What arguments to you want to pass to the function?
trying to print out #cout << x << " to the power " << y << " = " << sum << endl;
Yeah, but you have to pass in the values of x, y and sum when you call the function.

Example: Calling the function as utkoma(1, 2, 3); will print "2 to the power of 3 = 1".
you have to pass in the values of x, y and sum when you call the function.
By: Peter87
He's correct.
you have to enter numbers there instead of the integer names.
Topic archived. No new replies allowed.