Best channel for computer science students so far. Thanks for making such great contents.
@boblopez7649 Жыл бұрын
I did this program using shift left operator(
@mayankjadhav45096 жыл бұрын
Thank you so much sir...today i understood the program and Sir please post binary to octal and hexadecimal too...
@Obama64642 жыл бұрын
Great lecture. Many ways this can be done (including using the math.h library and utilizing the pow() function) but the previous person that taught me this didn't explain why we were doing the modulus and division in a clear way. You, however, did. Thanks!
@-HarishkumarG3 жыл бұрын
Idk how am I going to survive in IT field 😭
@ibtissamelhammoumy95863 жыл бұрын
don't worry
@-HarishkumarG3 жыл бұрын
@@ibtissamelhammoumy9586 thanks :-)
@AshutoshKumar-jj6kz2 жыл бұрын
same here no logic only magic in programming
@nileshtayade35462 жыл бұрын
Don't worry bro me bhi apke jaisa hi sochta tha lekin dhire dhire Sab samaj ate jata hai bas koshish karte rho
@AlameenAdeyemi10 ай бұрын
It's 2024,how are u doing now bro
@ramdayalkumawat25684 жыл бұрын
Sir this is so wonderful lecture
@madhavikatta73466 жыл бұрын
Thank you so much Sir one day I will be in the good position definitely on that day I will sponsor huge amount money to our channel
@ashokkumark22434 жыл бұрын
We store hex value starts with 0x, and octal starts with 0 and decimal as it is in the integer type.. How do we store a binary number in the integer type?? Here why do we convert a decimal number to decimal again?? Where actually is it useful?? Can someone please explain??
@AidenSalts4 жыл бұрын
what?
@mdabubakar68743 жыл бұрын
have u read digital electronics???
@roshnimishra34546 жыл бұрын
nice one made the concept very clear very helpful
@dambro33122 жыл бұрын
i did it using biwise operators! it worked! ig int bin_dec() { int bin,dec; scanf("%d",&bin); for (int shift; bin!=0; shift++) { int r = bin%10; dec = (r
@rudrachakraborty7896 Жыл бұрын
Thank you, sir. This really helped me with my paper 1 programming practice. From London
@nikhilsingh76663 жыл бұрын
nice lecture I got a hint for the CodeChef challenge thanks
@arnoldgatchalian86433 жыл бұрын
Thank you I've learned a lot from you
@Deepthi_Chowdary5321 Жыл бұрын
Sir u make more series on only focusing on problem..
@YashDEVELOPER124 жыл бұрын
Very beautiful explanation sir.. u r amazing 🙏
@HuynhThanhThuan4 жыл бұрын
Very easy to understanding, thank you dear Sir.
@vinaykamble1623 жыл бұрын
It's amazing explanation ❤️
@shreya92752 жыл бұрын
Absolutely Brilliant explanation
@beauty-ez8ox Жыл бұрын
Wow 💜💜💜 ... So nicely explained
@kapiljetwani35403 жыл бұрын
thank u for such a nice explaination!
@avishekkbhatta Жыл бұрын
best channel.................................................
@shikhajamwal47093 жыл бұрын
u have explained it very well
@tumutarun51576 жыл бұрын
Upload all videos in c language for learners
@mdmuquimakhter51452 жыл бұрын
awesomely explained
@sahilarora71862 жыл бұрын
very nice explanation thank you sir
@itsbayahmed Жыл бұрын
Here is another solution to this problem: #include #include int main() { long long int number, num, result, n; printf("Please Enter the Binary number: "); scanf("%lld",&number); result = 0; n =0; num = number; while(num != 0) { result = result + (num % 10) * pow(2,n) ; n++; num = num / 10; } printf("%lld in decimal is %lld", number, result); return (0); }
@nishabhandari51903 ай бұрын
Thank you so much professor
@gayathripvl81843 жыл бұрын
sir you are doing very great job
@gopichowdary20406 жыл бұрын
Sir please upload daily one video like circuit theory videos are being uploaded
@Hichamb042 жыл бұрын
thanks bro that was so helpful .
@aakashmudigonda33754 жыл бұрын
if anyone of you guys, didn't understand the above code, this my own code, which I made from a simpler logic.... #include #include int main(void) { // example : convert 1 0 0 1 to decimal // [1]*2^(3)+ [0]*2^(2)+ [0]*2^(1) + [1]*2^(0) printf("enter a binary number : "); int n; scanf("%d",&n); int temp = n; int rem = 0; int result = 0; int count = 0; int last_num= 0; while (temp!=0) { temp = temp/10; count++; } temp = n; for (int i = 0; i
@namraarif1004 жыл бұрын
Very helpful video sir But you did not initialize rem in start. Will it not a problem to run this program?
@manojraut96302 жыл бұрын
You are Best.👏
@andistheinforitbutso75132 жыл бұрын
All hail 🙌 Neso Academy
@HelderKJPedro2 жыл бұрын
Thank you so much 🙏🏽
@5303sandeep5 жыл бұрын
Here is the code for invalid input for eg:- 1201(which is not binary) #include int main() { //Initialization and user input int b,rem,decimal = 0,w = 1,num,c=0;//w = weight,b = binary printf("Enter binary number to covert to decimal "); scanf("%d",&b); num = b; //Binary to Decimal Conversion while(num!=0) { rem = num%10; if(rem>1) { printf("Invalid input:Input contains number other than 0 and 1 Please enter a valid input "); c = 1; break; } else { decimal = decimal + rem*w; num = num/10; w = w*2; } } //Printing result if(c==0) printf("%d is the decimal conversion of binary %d",decimal,b); }
@tusharmathur53603 жыл бұрын
thanks bro for sharing
@komkirisma33472 жыл бұрын
how to do it for decimal?
@basics6986 жыл бұрын
Please make videos on control systems.
@Khadra20243 жыл бұрын
if i want to check if the number have only 1 and 0 how can i do that? if it has other number, send error message :(
@mdathar19472 жыл бұрын
Sir pls cover the corners case also...
@mdathar19472 жыл бұрын
If I enter a binary contain more than 10 digit ....2. if I enter for eq-101101010101 Will your program work in these 2cases??
@zoreladreanrivera98227 ай бұрын
#include #include int main ( void ) { int binary; printf ( "Enter binary number: " ); scanf ( "%d", &binary ); int counter1 = 0; int A = binary; while ( A != 0 ) { A /= 10; counter1++; } int remainder = 0; int power = 0; int sum = 0; for ( int counter2 = 0; counter2 < counter1; counter2++ ) { remainder = binary % 10; power = ( pow ( ( remainder * 2 ), counter2 ) ) * remainder ; sum += power; binary /= 10; } printf ( "Decimal Equivalent = %d", sum ); return 0; }
@bkrulz12804 жыл бұрын
How to write it in a recursive function
@ColorsOfLife1142 жыл бұрын
As the weight of first digit from right side is zero then why we take it 1???
@dheerajk73 жыл бұрын
Thankyou so much sir
@jagugamit1503 жыл бұрын
I am getting error Input :- 0011 Output :- 9 Expected output should : - 3
@sowmyapg33813 жыл бұрын
Understood thankyou
@ArunChoudhary-lr7rp11 ай бұрын
Outstanding
@ic4r0234 жыл бұрын
Very good video. But I replicated the exact same code in Dart (doing the syntax changes) and the result was different! It gave me 11.24999999. There is my code in Dart: num binary = 1001; num decimal = 0; var base = 1; void main (){ while(binary != 0){ var rem = binary % 10; decimal = decimal + rem*base; binary = binary / 10; base = base*2; } print(decimal); } Can someone please explain to me where I'm wrong?
@tusharmathur53603 жыл бұрын
seems nothing wrong
@ramanandasharma92142 жыл бұрын
please give the flowchart and algorithm for this
@sinchana93584 жыл бұрын
Plzz make a vedio on how to convert decimal to binary plzz sir🙏🙏
@archipalexandru-ioan58983 жыл бұрын
#include int main() { int var=65; int i; int bit; for(i=8;i>0;i--) { bit=(var>>i-1) &1; printf("%d",bit); } }
@archipalexandru-ioan58983 жыл бұрын
here you have,65 is the number converted to binary,the for its from 8 to 1,so you can store the bits from left to right
@songoku20133 жыл бұрын
But what if the input is '101.011' or any other fractional binary number ? How to program that ?
@TheJoker-xw5pd3 жыл бұрын
Bro agar hum koi or number add kare like as jo binary me na ho to code invalid ana chaiye to kaise hoga
@Ginihiniikk9864 жыл бұрын
what is weight??
@rameshv27624 жыл бұрын
It's a decimal value of number at certain position in a binary number.. Wn you travel from Lsb to msb... The value changes frm 2 to 2^n ..🙂
@gamingcousinstamil2 жыл бұрын
Super sir
@poojajagtap63563 жыл бұрын
thanks sir
@nazmashaik25585 жыл бұрын
Sir I execute this program but the out put is not correct there is so different.what can I do
@AdityaGupta-pl1ss3 жыл бұрын
What is the meaning of Weight here
@ashishsinha88936 жыл бұрын
Sir u r going to upload videos in daily basis or not ???????
@muhammedshafeek39053 жыл бұрын
In code blocks if I use space in print"%d " after %d before " once I build the code code block become stuck how I solve this
@jagadeeshwaran15123 жыл бұрын
I just added a feature to this program, i.e., to display a error message when a non binary number is entered.
@subhadeepsinha10063 жыл бұрын
how r you pirate king??
@minku21082 жыл бұрын
Program for binary to hexa?
@true41894 жыл бұрын
Thank u
@mousex55326 жыл бұрын
thankyou
@amudhapi64924 жыл бұрын
Why weight=1 and what r the purpose for use weight plz reply me
@arunjithajith79583 жыл бұрын
Weight is base Initially base value will be 1 so we initialise weight with 1
@amudhapi64923 жыл бұрын
@@arunjithajith7958 Thank u Arunjith
@muskanustad38342 жыл бұрын
What about negative binary numbers🙄?
@avinashyadav85984 жыл бұрын
Program dont work for 0011
@jagugamit1503 жыл бұрын
Same bro
@satyanarayanakoppuravuri1615 жыл бұрын
if we give binary as 0000 ?
@krank38695 жыл бұрын
it's gonna return 0.
@hatemali422010 ай бұрын
Enta gamed strong
@sharuhasans94175 жыл бұрын
How 1 divd by 10 remainder will b 1
@Vinay_Yarramsetty4 жыл бұрын
10) 1 (0 0 ------------- 1 I think this is the way But not like 1) 10 (10
@gourabdutta70862 жыл бұрын
10*0=0..so remainder will be 1
@donpilarsuarezgudino51603 жыл бұрын
This code don't work in Python... Any help??
@donpilarsuarezgudino51603 жыл бұрын
Problem solved: don`t worry any more folks
@goldendragon53715 жыл бұрын
Binary to octal please bro..... >.
@Naveen-n3p1i15 күн бұрын
Is not working all values🤷♂🤷♂🤷♂🤷♂
@reimannintegrability Жыл бұрын
😢
@harshitha61606 жыл бұрын
First view, and first comment
@Kartik001arts2 жыл бұрын
Codes don't get executed which you teach in the window.....
@redricblue87902 жыл бұрын
Why did I choose software engineering? It's fucking hard
@aldolhitlercondensation13632 жыл бұрын
Hey I'm sorry you feel this way. This is actually fun if you get the concept, let me try and help. So the decimal number system (the system we naturally use) is very similar to the binary number system. Figuring out this key difference is all the logic you need to write the code. So for instance, to find the value of any decimal number we're actually multiplying each constituent digit with increasing powers of 10 for eg: 139 = 1*10^2 + 3*10^1 + 9*10^0 . It's just that we do this so naturally so that we don't usually give it a second thought. The decimal number system supports the digits [0-9] Comparing this with the very similar BINARY number system which just supports the digits 0 & 1, to get the value of a binary number we're simply multiplying the digit (bit) at each position with increasing powers of 2! for eg: 1011 represents 1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 1 * 2^0 i.e the digit 11 in decimal. This is all the software engineering aspect there is. The rest is basically figuring out the fundamentals of any language to execute this. In fact, I would urge that you write your own code once you know this logic without referring the video. All you need to do that is i) knowledge of how to extract bit by bit from a given input ii) how to compute powers iii) how to use loops and conditional statements. Googling each of these gives you a clear idea of what they do. I hope i was able to help