CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,000+ Interview Questions asked in actual MNC Interviews - all with model answers.

Sponsored Links

Interview Questions
Our Services

INTERVIEW QUESTIONS PROGRAMMING LANGUAGES DETAILS
Question :
How to convert decimal to binary and its formula?


Posted by: pandesal on 11/6/2013

Contact pandesal Contact pandesal
Category Programming Languages Interview Questions
Rating (3.7) By 46 users
Added on 11/6/2013
Views 638
Rate it!


Answers:

Source: CoolInterview.com

Its very simple ,just divide the decimal number by 2 and note down the remainder(which will be either 1 or 0) ,then again divide the quotient obtained in the first step and note down the remainder..........repeat the step till u get 0 as quotient n write the remainders in reverse order that means the last step remainder will b e the leftmost digit of the binary equivalent of given decimal number.
Source: CoolInterview.com



Posted by: Preeti

Contact Preeti Contact Preeti

Source: CoolInterview.com

long int bin(int d)
{
int rem,pow=1;
long int b=0;
while(d>0)
{
rem=d%2;
b+=(pow*rem);
d/=2;
pow*=10;
}
return b;
}

Source: CoolInterview.com



Posted by: Shree Rashmi C

Contact Shree Rashmi C Contact Shree Rashmi C

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification Enter the above shown code: *
    Inform me about updated answers to this question

    Related Questions
    View Answer
    What is profiling in c or c++?and what is rtdi?is it part of c or c++?
    View Answer
    void main()
    {
    int i=20;j=35,x,y;
    x= y++ + x++;
    y= ++y + ++x;
    printf(" %d %d" , x,y);
    }
    /* please tell me the value of x and y at each and every moment. i dont need the answer but the explanation of the anamolus behavior of increment expression.*/
    View Answer
    Which language should be learn for getting better job?
    View Answer
    How can we print sum of two number without using main function?
    View Answer
    What is a dangling pointer ?
    View Answer
    I am a new programmer in C & can't find <graphics.h> library. can anyone help me with this?
    View Answer
    How type of questions asked in campus interview? please tell me.
    View Answer
    What is the purpose of semicolon in c?
    View Answer
    What is the purpose of the semicolon(;) in languages?
    View Answer
    How to create Crystal Report in Visual Basic 6.0
    View Answer
    In VB which control does not have event?
    View Answer
    What are the differences between malloc() and calloc()?

    What are macros? what are its advantages and disadvantages?
    View Answer
    What is Thread ?
    (VC++)
    What is the difference between Cmutex and Csemaphone?


    View Answer
    What is LPCTSTR? What does LP denote it?

    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Programming Languages Interview Questions & Answers

    User Options
    India News Network

    Latest 20 Questions
    What is Repurchase Agreements or (Repo) in Futures and Options Trading Market?
    Who is Registered Representative in Futures and Options Trading Market?
    What is Reciprocal of European Terms in Futures and Options Trading Market?
    What is Range (Price) in Futures and Options Trading Market?
    What is Rally Reaction in Futures and Options Trading Market?
    What is Put Option in Futures and Options Trading Market?
    What is Purchasing Hedge or Long Hedge in Futures and Options Trading Market?
    What is Purchase and Sell Statement in Futures and Options Trading Market?
    What is Pulpit in Futures and Options Trading Market?
    What is Producer Price Index (PPI) in Futures and Options Trading Market?
    What is Prime Rate in Futures and Options Trading Market?
    What is Primary Dealer in Futures and Options Trading Market?
    What is Price Limit Order in Futures and Options Trading Market?
    What is the meaning of Forfeiting?
    Describe the two components of financial restructuring?
    What is the meaning of Capital Restructuring?
    State the demerits of Merges and Acquisitions?
    State the merits of Mergers and Acquisitions?
    What is the difference between Mergers and Acquisition?
    State the types of Merger?



    Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

    Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

    MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
    MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

    GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

    IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
    IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

    SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
    SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions



    Cache = 0 Seconds