SHARE
TWEET

Untitled

a guest Jan 26th, 2020 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <string.h>
  4. int main()
  5. {
  6.     int out[100];
  7.     int n,i=0;
  8.     scanf("%d",&n);
  9.     while(n>0){
  10.         out[i] = n % 2;
  11.         n = n / 2;
  12.         i++;
  13.     }
  14.     for (int j = i - 1; j >= 0; j--)
  15.         printf("%d",out[j]);
  16.  
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top