C++ program to convert a decimal number Therefore the equivalent binary number is 1010.īelow diagram shows an example of converting the decimal number 17 to equivalent binary number. Step 7: Remainder when 1 is divided by 2 is 1. Step 5: Remainder when 2 is divided by 2 is zero. Step 3: Remainder when 5 is divided by 2 is 1. Step 1: Remainder when 10 is divided by 2 is zero. Repeat the above two steps until the number is greater than zero.Store the remainder when the number is divided by 2 in an array.Recommended: Please solve it on “ PRACTICE” first, before moving on to the solution. ISRO CS Syllabus for Scientist/Engineer Exam. ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |