Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Puffin Rock Characters Plush Toy Set
anil1961
Updated:
Nov 7, 2026
Toyota Vitz scp10 For Sale
Lakmal Bandara
Updated:
Nov 4, 2026
Kandy
Welcome all my all new pet shop Bark.lk
dilumrane
Updated:
Nov 2, 2026
Windows RDP Only Rs.500 a month
Blogerwiki
Updated:
Nov 1, 2026
Ad icon
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
C help
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="kasuncs" data-source="post: 5009320" data-attributes="member: 31897"><p><span style="color: Red">Fixed code</span></p><p></p><p>[CODE]</p><p>#include<stdio.h></p><p>#include<stdlib.h></p><p></p><p>void D2B (int num)</p><p>{</p><p> int binary[16];</p><p> int x,i;</p><p> for(x=0;x<16;x++) /*array eka 1,0 ewain koitharam durakata fill unada balanna*/</p><p> binary[x]=0;</p><p> x=0;</p><p> while(num>=1) /*deken bedagena yanna*/</p><p> {</p><p> binary[x]=num%2;/* number eka deken bedala itiriya ganna*/</p><p> num/=2;/*number eka deken bedala ayeth deken bedanna while eke mulata yawanna.*/</p><p> /*hithapan 5 gaththa kiyala 5ta 2 ewa 2i itiri 1i ne. 1 array ekata dagena apahu 2 2n bedanawa*/</p><p> x++; /*array eka count karanna*/</p><p> }</p><p> //while(binary[x]!=' ')/* koi welawaka hari mul while eka return wenakota array eka koi tharam fill welada balanna*/</p><p> // x++;</p><p> for(i=x;i>0;i--)/* array eka reverce order ekata print karanna*/</p><p> printf("%d",binary[i-1]);</p><p> printf("\n");</p><p>}</p><p>void main()</p><p>{</p><p> int num;</p><p> printf("Enter your number :- ");</p><p> scanf("%d",&num);</p><p> D2B(num);</p><p> system("pause");</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="kasuncs, post: 5009320, member: 31897"] [COLOR="Red"]Fixed code[/COLOR] [CODE] #include<stdio.h> #include<stdlib.h> void D2B (int num) { int binary[16]; int x,i; for(x=0;x<16;x++) /*array eka 1,0 ewain koitharam durakata fill unada balanna*/ binary[x]=0; x=0; while(num>=1) /*deken bedagena yanna*/ { binary[x]=num%2;/* number eka deken bedala itiriya ganna*/ num/=2;/*number eka deken bedala ayeth deken bedanna while eke mulata yawanna.*/ /*hithapan 5 gaththa kiyala 5ta 2 ewa 2i itiri 1i ne. 1 array ekata dagena apahu 2 2n bedanawa*/ x++; /*array eka count karanna*/ } //while(binary[x]!=' ')/* koi welawaka hari mul while eka return wenakota array eka koi tharam fill welada balanna*/ // x++; for(i=x;i>0;i--)/* array eka reverce order ekata print karanna*/ printf("%d",binary[i-1]); printf("\n"); } void main() { int num; printf("Enter your number :- "); scanf("%d",&num); D2B(num); system("pause"); } [/CODE] [/QUOTE]
Insert quotes…
Verification
Payakata winadi keeyak tibeda?
Post reply
Top
Bottom