-5

Im trying to run a C++ program with binary output. Please help .

0000 0001 0010 0011 0101 0110 0111 1000 1111

Dupsey
  • 3
  • 2
  • 2
    Welcome to stackoverflow.com. Please take some time to read [the help pages](http://stackoverflow.com/help), especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). Also please [take the tour](http://stackoverflow.com/tour) and [read about how to ask good questions](http://stackoverflow.com/help/how-to-ask). Lastly please learn how to create a [Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve). – Some programmer dude Mar 13 '17 at 09:27
  • 4
    I'm voting to close this question as off-topic because SO is not a code writing service, please show your efforts – EdChum Mar 13 '17 at 09:27

1 Answers1

0

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.

prokawsar
  • 150
  • 1
  • 15