-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Labels
more info neededThe issue report is not actionable in its current stateThe issue report is not actionable in its current statequestiontasks/build/debugAn issue relating to tasks.json (e.g. build issues)An issue relating to tasks.json (e.g. build issues)
Description
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int n;
int bit=0;
int i=0;
int bin=0;
cout<<"enter n: ";
cin>>n;
while (n!=0)
{
bit=n&1;
bin=(bit*pow(10,i))+bin;
n=n>>1;
i++;
}
cout<<"the binary representation is "<<bin<<endl;
}this is the code i'm trying to run. this is the required output that i'm getting on an online compiler.
enter n: 16
the binary representation is 10000
however on vs code, this is the output:
enter n: 16
the binary representation is 9999
Metadata
Metadata
Assignees
Labels
more info neededThe issue report is not actionable in its current stateThe issue report is not actionable in its current statequestiontasks/build/debugAn issue relating to tasks.json (e.g. build issues)An issue relating to tasks.json (e.g. build issues)