Im trying to run a C++ program with binary output. Please help .
0000 0001 0010 0011 0101 0110 0111 1000 1111
Im trying to run a C++ program with binary output. Please help .
0000 0001 0010 0011 0101 0110 0111 1000 1111
This one could be
#include <bits/stdc++.h>
using namespace std;
int main(){
int i;
for(int i=1; i<10; i++){
string binary = bitset<8>(i).to_string();
cout << binary << endl;
}
return 0;
}
8 is bitset here.