2:01 PM
C++ Program of CONVERSION OF DECIMAL TO BINARY

Write a Program of CONVERSION OF DECIMAL TO BINARY

#include<iostream.h> 
#include<conio.h> 
 
void main()
{
int n,m,no=0,a=1,rem;
clrscr();
printf("Enter any decimal number->");
scanf("%d",&n);
m=n;
while(n!=0)
{
rem=n%2;
no=no+rem*a;
n=n/2;
a=a*10;
}
printf("The value %d in binary is->",m);
printf("%d",no);
getch();
}
 
Note:
      If you want to change in this program please write through the comment on this page. you can also past similar program 
                 of c++ with output.your comment is valuable to the other user and person.
Views: 110 | Added by: vijoriya | Tags: DECIMAL, Conversion, c++, program, Binary | Rating: 0.0/0
Total comments: 0
avatar