files renamed to standard - without spaces and made CPPLINT compatible

This commit is contained in:
Krishna Vedala
2020-05-25 23:13:26 -04:00
parent 4e8a2f7151
commit 120fe06fcb
14 changed files with 211 additions and 124 deletions

View File

@@ -0,0 +1,25 @@
// This function convert decimal to binary number
//
#include <iostream>
using namespace std;
int main()
{
int number;
cout << "Enter a number:";
cin >> number;
int remainder, binary = 0, var = 1;
do
{
remainder = number % 2;
number = number / 2;
binary = binary + (remainder * var);
var = var * 10;
} while (number > 0);
cout << "the binary is :";
cout << binary;
cout << endl;
return 0;
}