#include<iostream>
usingnamespace std;
int main()
{
int num = 0, store = 0;
char choice;
while (true)
{
cout << "\nEnter The Number : ";
cin >> num;
if (num % 3 == 0)
{
cout << num << " is divisible by 3\n";
store += num;
}
if (num % 5 == 0)
{
cout << num << " is divisible by 5\n";
store += num;
}
cout << "\nEnter Y To Continue or N to Quit : ";
cin >> choice;
if (choice == 'n' || choice == 'N')
break;
}
cout << "\nThe Sum is " << store << endl;
system("pause");
}
#include<iostream>
usingnamespace std;
int main()
{ int num = 0, store = 0;
char choice;
bool divisible;
while (true)
{ divisible = false;
cout << "\nEnter The Number : ";
cin >> num;
if (num % 3 == 0)
{ cout << num << " is divisible by 3\n";
divisible = true;
}
if (num % 5 == 0)
{ cout << num << " is divisible by 5\n";
divisible = true;
}
if (divisible)
store += num;
cout << "\nEnter Y To Continue or N to Quit : ";
cin >> choice;
if (choice == 'n' || choice == 'N')
break;
}
cout << "\nThe Sum is " << store << endl;
system("pause");
}