Convert Decimal To Binary Number

in Hindi - Convert Decimal To Binary Number



not yet

Source Code :

RUN#include<iostream.h>
#include <conio.h>
#include<math.h>

int main()
{
int num, rem=0, num1=0, i=0;
cout<<"Enter decimal value(0 to 9): ";
cin>>num;

while(num > 0){
rem = num % 2;
num1 = num1 + rem * pow(10, i);
i++;
num = num / 2 ;
}
cout<<"Binary number "<<num1;

return 0;
}