7 kyu

Convert Integer to Binary

839 of 2,037DivyanshBatham

Description:

Convert integers to binary as simple as that. You would be given an integer as a argument and you have to return its binary form. To get an idea about how to convert a decimal number into a binary number, visit here.

Notes: negative numbers should be handled as two's complement; assume all numbers are integers stored using 4 bytes (or 32 bits) in any language.

Your output should ignore leading 0s.

Examples (input --> output):

3  --> "11"
-3 -->"11111111111111111111111111111101"

Be Ready for Large Numbers. Happy Coding ^_^

Binary
Fundamentals

Stats:

CreatedMay 23, 2015
PublishedMay 23, 2015
Warriors Trained4732
Total Skips324
Total Code Submissions9352
Total Times Completed2037
JavaScript Completions839
Ruby Completions187
Python Completions822
C# Completions227
C Completions55
COBOL Completions3
Total Stars77
% of votes with a positive feedback rating89% of 352
Total "Very Satisfied" Votes287
Total "Somewhat Satisfied" Votes51
Total "Not Satisfied" Votes14
Total Rank Assessments13
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • DivyanshBatham Avatar
  • dnolan Avatar
  • Abbe Avatar
  • GiacomoSorbi Avatar
  • user5036852 Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • kirull Avatar
  • akar-0 Avatar
  • farhanaditya Avatar
  • saudiGuy Avatar
Ad