So I'm trying to do a challenge called 3n+1, where I have to tell how many times the program has to multiply or divide until n=1 but I don't get any output from the program. Please help? p.s. I'm using C++ 14
#include <iostream>
using namespace std;
int n;
int d=0;
int main() {
cin>> n;
for(int i=n; i<=1;){
if(n=1){
cout<< d;
}
else if(n%2==0){
d++;
n/2;
}
else{
d++;
n*3+1;
}
}
return 0;
}