Vyom World.com Let's Touch the Sky Together!
 Home VyomWorld.com Home Free Magazines! VyomLinks.com Home JobsAssist.com Home Vyom Network Contact Us Jobs & Careers Resume Submitter Placement Papers IT Companies Directory Computer Jobs Interview Questions Online Exams Vyom Career eMag. Fun Screensavers New! Send FREE SMS! SMS Jokes Source Codes Library Source Codes Home ASP Source Codes C Source Codes C++ Source Codes COBOL Source Codes Java Source Codes Pascal Source Codes Submit Source Codes GATE GATE an Overview GATE Preparation Study Materal GRE GRE an Overview GRE Questions GRE Preparation GRE Universities TOEFL Preparation TOEFL Resources GMAT Preparation GMAT Resources MBA Preparation MBA Resources Networking Concepts Networking Concepts Testing Preparation Testing Resources Webmasters Free Traffic Builder Webmaster Articles Web Hosting Tutorials Hardware Tutorial 1500 Free eBooks New! FREE Publications
Vyom Career eMag.
 Get 9,000+ Interview Questions & Answers in an eBook. 9,000+ Interview Questions All Questions Answered 5 FREE Bonuses Free Upgrades Get it now!
Get 9,000+ Interview Questions with Answers in an eBook

Home >> Source Codes Library Home >> Language Home >> Category Home > > Item Description
Search Code Library

 Title Program to display decimal equivalent of a input binary number. Description: Hits: 2611 Since 25th November, 2003 Code: Select and Copy the Code #include #include #include void btod(int b[]); int c; void main() { int a[5],d,i,e,f,g; clrscr(); printf("What will be the length of input no.? "); scanf("%d",&c); printf("Don't exceed input from your input limit or 5 digits in any case"); printf("\nEnter no.:- "); scanf("%d",&d); for (i=c-1;i>=0;--i) { e = pow(10,i); a[i] = d/e; d = d%e; } btod(a); printf("\n\n\n\n\n\t\t\tHAVE A NICE DAY! BYE."); getch(); } void btod(int b[]) { int k,s=0,i,n; n=*b; for (i=c-1;i>=0;--i) { if (i>0) *b=*(b+i); else *b=n; if (*b==1) { k=pow(2,i); s=s+k; } } printf("\nIts decimal equivalent is %d",s); return; }

ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home