Here's my code. Whenever I run the program, I expect that the cout statement in the for loop in the function Binary() to execute. But whenever I input something, it gives me 0
#include<iostream>
#include<math.h>
using namespace std;
long int Binary(int x){
int temp=0,res=0;
for(int i=x;i<0;i--){
temp++;
res=res+ pow(10,temp)*(i%2);
i=i/2;
cout<<i<<" "<<res<<endl;
}
return res;
}
int main(){
int x; cin>>x;
cout<<endl<<Binary(x);
return 0;
}