binary_to_deci

February 22, 2019
binary_to_deci
// binary to deci.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;
int main()
{
int n=0,rem=0,deci=0,i=1;
cout <<"Enter the binarry number:";
cin>>n;
while (n!=0)
{
rem = n%10;
n=n/10;
deci =deci+ rem*i;
i*=2;
}
cout<<"deci="<<deci;
return 0;
}

No comments:

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();
Powered by Blogger.