tag:blogger.com,1999:blog-959939550345671470.post623036911199912108..comments2024-03-17T12:50:37.677+05:30Comments on C programming Interview questions and answers: CONVERSION OF DECIMAL TO BINARY USING C PROGRAMPriyanka kumarihttp://www.blogger.com/profile/08145649011863585828noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-959939550345671470.post-70367917400032861612013-04-16T16:30:35.205+05:302013-04-16T16:30:35.205+05:30this helped me a lotthis helped me a lotAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-53847894390463807932011-12-28T23:45:28.159+05:302011-12-28T23:45:28.159+05:30can any one explain me the above programcan any one explain me the above programkhushinoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-91863077384249372562011-05-30T15:09:56.223+05:302011-05-30T15:09:56.223+05:30change the int to long and this code works for lar...change the int to long and this code works for large noAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-57516214508526072932010-02-27T14:23:21.304+05:302010-02-27T14:23:21.304+05:30#include
#include
int main()
{
int no,p=0,rem;
l...#include<br />#include<br />int main()<br />{<br /> int no,p=0,rem;<br /> long int sum=0;<br /> printf("Enter a number:");<br /> scanf("%d",&no);<br /> while(no!=0)<br /> {<br /> rem=no%2;<br /> sum=sum+rem*pow(10,p);<br /> no=no/2;<br /> p++;<br /> }<br /> printf("The Binary Equivalent is:%ld\n",sum);<br /> return 0;<br />}yogesh_madhurihttps://www.blogger.com/profile/06980130321036511331noreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-7299883053927048122008-08-22T17:53:00.000+05:302008-08-22T17:53:00.000+05:30I tried this code but it didn't work with large nu...I tried this code but it didn't work with large numbers.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-959939550345671470.post-40840427284572863062008-08-22T13:02:00.000+05:302008-08-22T13:02:00.000+05:30this code seems to work only for small numbers.i t...this code seems to work only for small numbers.<BR/>i tried to input 32 but it gives the wrong output. how come?Anonymousnoreply@blogger.com