Answer:
Step-by-step explanation: Given a number N. Given two numbers X and Y, the task is to find the sum of all those numbers from 1 to N that are divisible by X or by ... Sn = (n/2) * {2*a + (n-1)* d} ... + (N / (X * Y) - 1) * (X * Y))/ 2;. return S1 + S2 - S3;. } // Driver code. int main().
hope this is right