-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_23Divisible.cpp
More file actions
36 lines (33 loc) · 829 Bytes
/
_23Divisible.cpp
File metadata and controls
36 lines (33 loc) · 829 Bytes
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
#include <iostream>
using namespace std;
int main()
{
int choice;
do{
int number;
cout << "Enter a number: ";
cin >> number;
cout << endl;
if (number % 5 == 0 && number % 11 == 0)
{
cout << number << " is divisible by 5 and 11" << endl;
}
else if (number < 0)
{
cout << "Please enter a positive number" << endl;
}
else
{
cout << number << " is not divisible by 5 and 11" << endl;
}
cout << "\nPress 1 to continue: \nPress 0 to exit: \nEnter your choice: ";
cin >> choice;
if (choice == 0)
{
break;
}
cout << endl;
}while(choice == 1);
cout << "\nThankyou user the program is over :)";
return 0;
}