Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. write a c program to convert decimal no to binary

write a c program to convert decimal no to binary

Scheduled Pinned Locked Moved C / C++ / MFC
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Devansh Chowdhury
    wrote on last edited by
    #1

    #include #include int main() { int a,b,i,c; b=0; scanf("%d",&a); i=a; while(i<0){ i=a; b=0; b=b*10+i%2; printf("%d",b); c=i%2; switch(c){ case '0': i=i/2; case '1': i=(i-1)/2; } } printf("%d",b); return 0; }

    Richard DeemingR 1 Reply Last reply
    0
    • D Devansh Chowdhury

      #include #include int main() { int a,b,i,c; b=0; scanf("%d",&a); i=a; while(i<0){ i=a; b=0; b=b*10+i%2; printf("%d",b); c=i%2; switch(c){ case '0': i=i/2; case '1': i=(i-1)/2; } } printf("%d",b); return 0; }

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You have already posted this homework in QA: Convert decimal number to binary[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups