C Program to Convert Decimal Number to Binary Number

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2020
  • This program is to convert decimal to binary in C. After watching this video, you will be able to convert any decimal number to binary in C
    ►This video is a part of this C Programming Practice Programs Playlist: • C Language Practice Pr...
    ►Checkout my English channel here: / programmingwithharry
    ►Click here to subscribe - / @codewithharry
    Best Hindi Videos For Learning Programming:
    ►Learn Python In One Video - • Python Tutorial In Hin...
    ►Python Complete Course In Hindi - • Python Tutorials For A...
    ►C Language Complete Course In Hindi -
    • C Language Tutorials I...
    ►JavaScript Complete Course In Hindi -
    • JavaScript Tutorials I...
    ►Learn JavaScript in One Video - • JavaScript Tutorial
    ►Learn PHP In One Video - • Learn Php In One Video...
    ►Django Complete Course In Hindi -
    • Python Django Tutorial...
    ►Machine Learning Using Python - • Machine Learning Tutor...
    ►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
    ►Advanced Python Tutorials - • Intermediate/Advanced ...
    ►Object Oriented Programming In Python - • Object Oriented Progra...
    ►Python Data Science and Big Data Tutorials - • Python Data Science an...
    Follow Me On Social Media
    ►Website (created using Flask) - www.codewithharry.com
    ►Facebook - / codewithharry
    ►Instagram - / codewithharry
    ►Personal Facebook A/c - / geekyharis
    Twitter - / haris_is_here

ความคิดเห็น • 395

  • @munol2524
    @munol2524 ปีที่แล้ว +7

    Last semester, I made a program to convert from base 10 to base n, but I didn't know how to convert fractional numbers. I was inspired by your video title to create a program that can accept rational inputs like 32.47. I first sat down and figured out the algorithm to convert the given number's integer and fractional parts to binary on paper (using reminders and division for the integer part, and multiplication and subtraction for the fractional part). Then, I generalized it to base n and wrote the program in C.Since higher bases need more digits than 0-9, I used letters A-Z and a-z to represent higher bases.
    To handle negative values, the program will print "-" and then take the absolute value and proceed.
    Here is the program. Please feel free to read it and suggest improvements. I have tried to include extensive comments for the reader's convenience.
    #include
    #include
    char digit(int d1){//convert given number to it's corresponding digit
    if (d1 < 10)
    return(d1 + 48); //use digits [0 to 9]
    else if (d1

  • @kajalgoswami9530
    @kajalgoswami9530 3 ปีที่แล้ว +6

    Thankyou sir you teaches very well..now no confusion about this programme 😊

  • @eldrago3140
    @eldrago3140 3 ปีที่แล้ว +41

    The binary form of 12 will be 1100. Is it correct?

  • @codewithharryfanchannel559
    @codewithharryfanchannel559 3 ปีที่แล้ว +6

    You deserve millions subscribers.

  • @darshan_the_admin
    @darshan_the_admin ปีที่แล้ว +2

    Thank you bhaiyaajaan..... Aapke har eak videos Jo Maine dekhe hai, sabse kuch sikhaa huu, aur aage bhi sikungaa

  • @cristinarosales1423
    @cristinarosales1423 3 ปีที่แล้ว +4

    Thanks for these amazing videos... Can you please make videos covering other conversions and other questions which are common in online tests for internships and jobs!!?????
    Waiting!!!

  • @StatusWorld-bp2pq
    @StatusWorld-bp2pq 3 ปีที่แล้ว +2

    You are my best and favourite teacher in the world

  • @alinamalhotra9895
    @alinamalhotra9895 3 ปีที่แล้ว +6

    Perfectly syncing with my syllabus

  • @kingkie9536
    @kingkie9536 3 ปีที่แล้ว +1

    500k ki advance me badai.harry sir... 1, 2 din me ho to ho jaynge pakka❤💥👏

  • @HimanshuKumar-ec2hc
    @HimanshuKumar-ec2hc 2 ปีที่แล้ว

    thank you. very well explained.

  • @kairavgamit6354
    @kairavgamit6354 3 ปีที่แล้ว +1

    Nice video...sir....make many series on this type of DSA sub. Vid. and hard prob. vids.👍🏻

  • @suhaasgambhir2432
    @suhaasgambhir2432 3 ปีที่แล้ว +2

    Hell yeahhh 🤩
    Long asked question answered 😝

  • @harshitachaurasia1246
    @harshitachaurasia1246 3 ปีที่แล้ว +3

    Aaj hi ye digital electronics me pdhaya gya tha😂
    Everytime u match 😁👍

  • @adityagupta2850
    @adityagupta2850 3 ปีที่แล้ว +3

    program isn't running for 0

  • @chitranjankumarnirala7213
    @chitranjankumarnirala7213 3 ปีที่แล้ว +2

    Write a C program that accepts a decimal integer N (which may be a positive or negative) and a positive integer n from the keyboard and convert into n-bits binary representation B 2's compliment format. Finally, it prints both N (decimal), n, and B (binary in 2's complement) on the screen. You cannot use array.

  • @uncodeyourself4473
    @uncodeyourself4473 3 ปีที่แล้ว

    thanks harry bhai i had been searching this kind of question for long time

  • @darkangle9297
    @darkangle9297 2 ปีที่แล้ว

    I am bangladeshi.i think your youtube channel is the best for coding

  • @prakhardhyani7111
    @prakhardhyani7111 3 ปีที่แล้ว +3

    We can use in question a[9-i]=rem instead of a[I] and print the normal array 😁

  • @asparshraj9016
    @asparshraj9016 3 ปีที่แล้ว +1

    Bhaiya you are great and you upload informative videos...

  • @ashokbhongade3645
    @ashokbhongade3645 3 ปีที่แล้ว

    Thanks bhaiyaa. Mujhe is video ki bhot zarroorat thi

  • @yashwanth8350
    @yashwanth8350 2 ปีที่แล้ว +1

    16:45
    int i=4;
    while(n) {
    rem = n%2;
    n=n/2
    a[i]= rem
    i - - ;
    }
    Can we use this instead?
    Reply if u read this comment.

  • @rs2_0_225
    @rs2_0_225 หลายเดือนก่อน

    Thanks a lot Harry sir iss code ko samjhane ke liye..

  • @siddheshmohite283
    @siddheshmohite283 2 ปีที่แล้ว

    bohot sahi tarikese samjha ,thanks.

  • @everydayamazingofficial4615
    @everydayamazingofficial4615 3 ปีที่แล้ว +1

    hii Harry, please make a video on number system including hexadecimal, octal number system. As soon as possible .

  • @krishnachaudhary5392
    @krishnachaudhary5392 3 ปีที่แล้ว +4

    Sir i have almost complited the web development playlist.... But i have basic knolwde of php so can you please make a video on how to use php as a backend..... I felt php is easy for a beginner rather than node js...... So sirplease make a video on " Using PHP In backend....

  • @SarveshKumar-bl9in
    @SarveshKumar-bl9in ปีที่แล้ว

    confusion is clear now thanks harry

  • @anshitshukla7498
    @anshitshukla7498 3 ปีที่แล้ว +2

    Harry bhy Zindabad 🙏

  • @snorlaxcodes
    @snorlaxcodes 3 ปีที่แล้ว +1

    9:43 1100 in binary sir you are the best if you see this comment please reply and heart

  • @akashrautela8480
    @akashrautela8480 3 ปีที่แล้ว

    sir please tell me what theme you are using ... i love your tutorials
    please sir answer me🙏

  • @abhiaryan07
    @abhiaryan07 3 ปีที่แล้ว +1

    Bhai which headphones do you use.?
    Please reply.....

  • @alokkhulbay355
    @alokkhulbay355 3 ปีที่แล้ว

    Harry bhai one question plz tell
    We have to make a program to add two number of 80 digits using string we can do it or not because there is no any data type which can hold 80 digit number ?
    Please make avl video showing that program.
    I have tried it using string functions like by using a to I function of string but it did not work
    Plz make a video in that!!!!

  • @factodro1461
    @factodro1461 3 ปีที่แล้ว +1

    Our family is going to 5ook
    Congratulations 👍👍

  • @sangeetakanaujia3156
    @sangeetakanaujia3156 3 ปีที่แล้ว

    Sir ye program run krne k liye koi library add Krna hoga kya... Mere ko error dikha rha h no directory and no file added jabki maine new file bnayi h

  • @anonymusk9397
    @anonymusk9397 3 ปีที่แล้ว +1

    Bro please make your data structures and algorithms series in python too.please please 🙏🙏🙏🙏🙏🙏🙏🙏

  • @t-w-s1307
    @t-w-s1307 3 ปีที่แล้ว +1

    harry bhai thank you for this special trick.
    mene 12 ka binary sy decimal ki h.
    the answer is=(1100)

  • @aarkestraclub326
    @aarkestraclub326 3 ปีที่แล้ว

    Sir I want to request a thing that use light theme on vs code during recording.

  • @technobd793
    @technobd793 3 ปีที่แล้ว +1

    Thanks sir . And love from bangladesh

  • @jasmeetsingh8603
    @jasmeetsingh8603 3 ปีที่แล้ว

    Thank You for Video!

  • @monusinghrawat2911
    @monusinghrawat2911 3 ปีที่แล้ว

    really great sir thank you so much.........

  • @subhajitghosh3867
    @subhajitghosh3867 3 ปีที่แล้ว +1

    I am very beginner , everything I have leaned from u. I have written the java code for this question.
    package project1;
    import java.util.Scanner;
    public class DecToBin {
    public static void main(String[] args){

    int[] arr = new int [10];
    Scanner input = new Scanner(System.in);
    System.out.println("Enter your desire Number");
    int n = input.nextInt();
    int reminder;
    int i=0;
    while(n!=0){
    reminder = n % 2;
    n = n/2;
    arr[i] = reminder;
    i++;
    }
    System.out.println("The Binary is");
    for(int j=i-1;j>=0;j--)
    {
    System.out.print(arr[j]);
    }
    System.out.println();
    }
    }

  • @AdarshSingh-cb5yf
    @AdarshSingh-cb5yf 3 ปีที่แล้ว

    Thank you sir ......
    (My great sir .......) 😍😍❤️❤️❤️❤️❤️❤️❤️❤️

  • @Aryavart..
    @Aryavart.. 3 ปีที่แล้ว +17

    9:45 --> here ✓ is used for division.
    2✓12 = 0, 2✓6 = 0, 2✓3 = 1, 2✓1 = 1
    Finally 12 ----> 1100.

  • @pivotprogrammer5602
    @pivotprogrammer5602 3 ปีที่แล้ว +1

    Harry bhai content >= software engineer degree
    (Harry bhai ka video apune ko real kame ka software engineer Bana dega)

  • @murr4551
    @murr4551 3 ปีที่แล้ว +3

    Sir , Please make a video on 'How to be a data scientist in 2020' full guidelines.....I am waiting for your instruction on this topic Sir. I have seen other TH-camrs video but they are not clear enough. I am 100% sure that your guidelines will be completely useful as it has always been. Thank you Sir.

  • @royfamily9273
    @royfamily9273 2 ปีที่แล้ว

    Thanks Harry Bhaiya

  • @codewithahmed9806
    @codewithahmed9806 3 ปีที่แล้ว +1

    Harry Sir Request !
    Please Make Advance Tkinter Course ......

  • @viral_video_ayana
    @viral_video_ayana 2 ปีที่แล้ว

    9:40 1100 thankyou bhai 😊support from rajasth

  • @yogeshchoudhary6828
    @yogeshchoudhary6828 3 ปีที่แล้ว

    Thanx

  • @53joyghorui17
    @53joyghorui17 2 ปีที่แล้ว

    harry bhai ap best ho yaar💥👏

  • @AmanRaj-wz6ds
    @AmanRaj-wz6ds 3 ปีที่แล้ว +1

    Bhai do while loop nahi use kar sakte hai kya comment jarur karna koi bhi jise conferm hai..

  • @jamilahusain7244
    @jamilahusain7244 3 ปีที่แล้ว

    plz make ds and algo series for absolute beginners.

  • @armaanmhate2911
    @armaanmhate2911 3 ปีที่แล้ว

    Please do a js full course from beginner to advanced 10 hrs course or something of that lenght

  • @bamanevishwajeet
    @bamanevishwajeet 3 ปีที่แล้ว

    Pleased harry bhai make this program in Python also....
    Love you...

  • @utkarshchandra8893
    @utkarshchandra8893 3 ปีที่แล้ว

    Thank you sir ❤❤❤

  • @hdgamer452
    @hdgamer452 3 ปีที่แล้ว +11

    Please make a playlist on Java
    Because in my book java is there but I can't understand
    Please make a playlist on java
    Please make a playlist on java
    Thanking you you and your work

  • @engineerbhai7642
    @engineerbhai7642 3 ปีที่แล้ว

    You are great sir.

  • @ishasinha5087
    @ishasinha5087 3 ปีที่แล้ว

    Thnxx for this vdo😊😊

  • @ShaizanOfficial
    @ShaizanOfficial 2 ปีที่แล้ว

    Thank you harry bhai

  • @pythonenthusiast9292
    @pythonenthusiast9292 3 ปีที่แล้ว +5

    Can you please do a live/recorded freelancer project for a software developer , like using python and django or according to the project requirements ?

    • @raseshshetty2386
      @raseshshetty2386 3 ปีที่แล้ว

      python enthusiast but I don’t think anyone would get allowed by the project provider to do so...

    • @pythonenthusiast9292
      @pythonenthusiast9292 3 ปีที่แล้ว

      @@raseshshetty2386 maybe.. i was curious as i saw few videos on solving live freelancer projects..I asked becoz his teaching style is unique and easy to understand. Still no worries if thats not possible.

  • @MATHEMATICIANMUHAMMADAHMAD
    @MATHEMATICIANMUHAMMADAHMAD 8 หลายเดือนก่อน

    thank you Haris bhai

  • @TOURPRM
    @TOURPRM 3 ปีที่แล้ว

    Awesome work sir

  • @akriti__
    @akriti__ ปีที่แล้ว

    Pls tell me using for loop and void main

  • @0xt66
    @0xt66 3 ปีที่แล้ว

    Sir, please do projects like restaurant billing system, pacman game, phone billing, quiz game and please explain these in details, thank you

  • @mayankmaurya3521
    @mayankmaurya3521 3 ปีที่แล้ว +1

    Great video

  • @sonalranpara1950
    @sonalranpara1950 3 ปีที่แล้ว

    Harry bhai mene html,CSS shikh liya hai
    Par mere mobile me html ka img teg rune nahi kr rhahai to me kya kru🙏🙏🙏

  • @cyberhacker7402
    @cyberhacker7402 3 ปีที่แล้ว

    Hey Harry bhai big fan name Shubham
    Bro I have a question pls answer me
    If we learn the whole web development like front-end and back-end what is the basic salary we got like a fresher pls help me

  • @sunitasaini4118
    @sunitasaini4118 ปีที่แล้ว

    Thank you sir 💜💫

  • @hrushikeshwaghmare7261
    @hrushikeshwaghmare7261 3 ปีที่แล้ว

    You are great bro .

  • @yashshah8440
    @yashshah8440 ปีที่แล้ว

    What about negative numbers?

  • @technoguide1462
    @technoguide1462 3 ปีที่แล้ว +1

    Sir please tell me how was that

  • @hiphopm7069
    @hiphopm7069 3 ปีที่แล้ว +1

    Sir jb mai aap ka c++, c ,ya java programming language dekhata hu to mere samjh me aata hai but pura nahi so aap daily ka 20 ya 40 minutes ka ek video uploaded kijiye

  • @RokyBeastX
    @RokyBeastX 3 ปีที่แล้ว

    Thanks Harry Bhai

  • @blackmangamer9265
    @blackmangamer9265 2 ปีที่แล้ว

    Thank you lot of 😀❤️

  • @walishaikh6433
    @walishaikh6433 3 ปีที่แล้ว

    Aap ka hi wait tha bhai pls java ka bhi bada one video banao pls🙏🙏

  • @StatusWorld-bp2pq
    @StatusWorld-bp2pq 3 ปีที่แล้ว +1

    Please make a video in how to run java script, phython ,java and c in together

  • @prajwalkklanjewar
    @prajwalkklanjewar 3 ปีที่แล้ว

    Bhai is type ke conversion ke aur video banao
    Hamare concept bhi clear honge.

  • @RohanDasRD
    @RohanDasRD 3 ปีที่แล้ว

    Awesome bhai♥️

  • @ishaanpachauri
    @ishaanpachauri 2 ปีที่แล้ว

    how to convert the binary into 8 bit format?

  • @soumyadeepkarmakar5702
    @soumyadeepkarmakar5702 3 ปีที่แล้ว

    plz make this video in hindi also. I am learining c language fromyour recent video on C.

  • @aayushmaurya1672
    @aayushmaurya1672 3 ปีที่แล้ว

    Bhai is list ko competitive tak leke jaoge?

  • @loveshkumar8159
    @loveshkumar8159 3 ปีที่แล้ว

    hello sir m pakistan se ho mene ap ki sab se
    pahely c++ wali video dekhi tu
    mujhe os video m bohat kuch sekhne ko mila
    ............. but i need u r help.............

  • @mahipalkumarwanika6053
    @mahipalkumarwanika6053 2 ปีที่แล้ว

    Very nice sir
    Mahipal kumar

  • @sandhyabhosale6328
    @sandhyabhosale6328 3 ปีที่แล้ว +1

    Heart dedo Harry bhai coder from Hogwarts vidhyalay Delhi

  • @rhythmmotwani6710
    @rhythmmotwani6710 2 ปีที่แล้ว +2

    9:40
    12 in decimal =1100 in binary

  • @sauravkumarjha6252
    @sauravkumarjha6252 3 ปีที่แล้ว

    Harry laptop me kaise pychamp ko zoom Kare without mouse click

  • @user-tl4fm3zn7u
    @user-tl4fm3zn7u 6 หลายเดือนก่อน

    for case of 0 , we can just simply initialize the array to {0}

  • @psurya3053
    @psurya3053 3 ปีที่แล้ว

    sir please make vedio on complete dsa.

  • @gulamashrafshaikh445
    @gulamashrafshaikh445 2 ปีที่แล้ว

    While loop me n=0 karte he to error q aati he????

  • @hiphopm7069
    @hiphopm7069 3 ปีที่แล้ว +1

    2 comment sir aap suru se coading sikhaye na PLZZ sir mai siwan se hu PLZZ sir

  • @AbhinandanMishra1
    @AbhinandanMishra1 3 ปีที่แล้ว

    Nice Video

  • @manojbhavsar3872
    @manojbhavsar3872 2 ปีที่แล้ว +2

    9:39 12 in binary = 1100

  • @DanishAnsari-gx9ph
    @DanishAnsari-gx9ph 3 ปีที่แล้ว +1

    Bro basic operating system banana batao please c programming se

  • @princegarg1086
    @princegarg1086 3 ปีที่แล้ว +1

    First comment
    Bhai react ke series b bnao please

  • @user-ub6wv3mk3m
    @user-ub6wv3mk3m 3 ปีที่แล้ว

    9:45 - 1100 DONE IN MIND

  • @sumitsaha6941
    @sumitsaha6941 3 ปีที่แล้ว

    Maza a gaya harry bhai❤

  • @vivakesavan186
    @vivakesavan186 3 ปีที่แล้ว

    Harry bhai ye video playlist me include nahi kiye ho aap ne

  • @shariquekhan6772
    @shariquekhan6772 3 ปีที่แล้ว

    Harry Bhai c++ wali playlist par videos aaayenge ???

  • @maheshdhorkule6847
    @maheshdhorkule6847 3 ปีที่แล้ว

    AWESOME bhai

  • @Xyz-wr6yj
    @Xyz-wr6yj ปีที่แล้ว

    what about negative numbers

  • @manikanchanbera85
    @manikanchanbera85 2 ปีที่แล้ว

    Decimal to binary conversion using bitwise operator (left shift) ka video bana dijiye plzz.