Basic Program to take an integer and returns 0 and 1s of that digit.

Create a Program That will take an integer and return a certain amount of 1 and 0's depending on the number of digits of the integer.
For example, the output should be
Enter an Integer: 543
100
This is what I got so far
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,count=0;
cout << "Enter an integer: " << endl;
cin >> n;

while(n!=0)
{
n/=10;
++count;
}



}
Topic archived. No new replies allowed.