This is a code that takes a series of 3 numbers in a number pattern and figures out the difference between them. everything seems to be right but my compiler keeps telling me I need an initializer before int i? sorry, I'm new to C++ so I'm sure my code is horrible.
using namespace std;
void add(int a, int b, int c)
    int i;
    for (a+i!=b;b+i!=c)
    {i=0; i<100; i++;}
    else {cout i;}
};
int main()
{
    int x, y, z;
    cin>>x;
    cin>>y;
    cin>>z;
    add(x, y, z);
}
 
     
    