diff --git a/C++/josephus_problem.cpp b/C++/josephus_problem.cpp new file mode 100644 index 0000000..9b47893 --- /dev/null +++ b/C++/josephus_problem.cpp @@ -0,0 +1,34 @@ +#include +using namespace std; +int main() +{ + int n,gap; + cout<<"Enter size of the array\n"; + cin>>n; + cout<<"Enter gap between the values\n"; + cin>>gap; + vector act; + for(int i=0;i calc; + calc.assign(act.begin(),act.end()); + int i; + int start=gap-1; +// cout<1) + { + for(i=start;i