//------------------------------------------------
#include <iostream>
#include <windows.h>
usingnamespace std;
//------------------------------------------------
//Main method
void main()
{
//Number to find the multiples below
int number = 0;
//X and Y
int x = 0;
int y = 0;
//General index value
int i = 0;
//The value to be printed
int sum = 0;
//Present the program to the user
cout << "This program finds the sum of all of the multiples \n";
cout << "of x or y below z. \n";
//Ask the user for the values
cout << "First input the value of z: ";
cin >> number;
cout << "\n";
cout << "Now x: ";
cin >> x;
cout << "\n";
cout << "Now y: ";
cin >> y;
cout << "\n";
//Now that we have the values, begin the loop
while (i <= number)
{
if (i % x==0)
{
//i is a multiple of x
//Add it to the sum
sum += i;
}
elseif (i % y==0)
{
//i is a multiple of y
//Add it to the sum
sum += i;
}
//Now check the next number
i += 1;
}
cout << "Sum = " + sum << endl << endl;
}
the ifs dont work and the program jumps to the last cout, how do I fix this