Online C++ Compiler

#include<bits/stdc++.h> using namespace std; int N_to_Zero(int N) { int count = 0; int i = 2; while((i * i) < N && (N % i)) { i++; } if((i * i) > N) { i = N; } count = 1 + (N-i)/2; return count; } int main() { int N = 10; cout<<"Count of operations of the given type required to reduce N to 0 are:"<<N_to_Zero(N); return 0; }