1:59 PM
C++ Program of CONVERSION OF BINARY TO DECIMAL

Write a Program of CONVERSION OF BINARY TO DECIMAL 

#include<iostream.h> 
#include<conio.h> 
 
void main()
{
long int no,n=0,j=1,rem,no1;
clrscr();
printf("Enter any number any binary form->");
scanf("%ld",&no);
no1=no;
while(no!=0)
{
rem=no%10;
n=n+rem*j;
j=j*2;
no=no/10;
}
printf("\nThe value of binary no. %ld is ->%ld",no1,n);
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: 122 | Added by: vijoriya | Tags: DECIMAL, program, c++, Conversion, Binary | Rating: 0.0/0
Total comments: 0
avatar