google search

Popular Posts


Welcome to BCA Notes

>>>>>>>>>>>>>>>>

Visitors

Search This Blog

Blogger templates

Visitor Map


Thursday 26 June 2014

c++ Basic projects Converting a Decimal number to Binary Number

Source Code:-

#include <stdio.h>
#include<conio.h>
#include<iostream.h>
 
int main()
{
    int n,p,c,k,count=0;
cout<<"Enter the number to find ";
cin>>n;
p=n;
while(p)//ye kevel no of digit nikalne kai liye hai
{
      p=p/10;
      count++;
  }
   
  cout<<"in binary number system is:";
  if (count=1)
  count=2;
 c=count*count*count;
  for (c; c >= 0; c--)//cout is the no of digit
  {
    k = n >> c;
 
    if (k & 1)
      cout<<"1";
    else
      cout<<"0";
  }
 
  cout<<"\n";
 getch();
  return 0;
}
For any questions query & output :-
Contact Me

rishabhbaid96@gmail.com

1 comments:

  1. https://www.google.co.in/search?q=c%2B%2B+Basic+projects+Converting+a+Decimal+number+to+Binary+Number&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:unofficial&client=firefox-nightly&channel=fflb&gfe_rd=cr&ei=MQesU8n-C5WFuASnuoDoCQ#channel=fflb&q=c%2B%2B+Basic+projects+Converting+a+Decimal+number+to+Binary+Number+bcaraipur.blogspot.in&rls=org.mozilla:en-US:unofficial

    ReplyDelete