Special Programs in C − Adding Two Numbers Without Using The Plus Operator (Half Adder Method)

  Рет қаралды 94,868

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 68
@Wesm
@Wesm 2 жыл бұрын
Why everyone here is happy? I didn't understand anything from this lesson. It's extremely hard!
@ajmalkhaniit
@ajmalkhaniit 5 жыл бұрын
Very neat clean vivid explanation with step by step solution programming made easy!
@ezhilv4358
@ezhilv4358 4 жыл бұрын
Bro I want to know the code for finding 2nd highest no. In a given integer..example 56879 in this value we have to find the 2nd highest no.
@shubhamjain4502
@shubhamjain4502 3 жыл бұрын
Thank u brother for making me understand in a simple way
@omgaikwad0510
@omgaikwad0510 3 жыл бұрын
Sir I understood all the previous topics in this Playlist but only this topic is difficult to understand. Please explain sum and carry variables and which value is exactly stored in them.
@tayyab.sheikh
@tayyab.sheikh 11 ай бұрын
Actually Half Adder is a concept of digital electronics, so you'll have to be somewhat familiar with it, you must know what are binary digits and how they are added inside the computer because as you know the computer understands binary digits (0,1) only and in Digital Electronics we deal with bits.
@tayyab.sheikh
@tayyab.sheikh 11 ай бұрын
If you learn binary addition and subtraction and then watch this video again, I'm sure you'll understand the concept given here.
@altyncharyyeva3108
@altyncharyyeva3108 2 жыл бұрын
Your lectures are very helpful for my classes. Thank you very much!!!
@mayuringale6898
@mayuringale6898 6 жыл бұрын
Mast Sir, Vedios so helpful for us,we all proud of you sir😘😘😘
@ezhilv4358
@ezhilv4358 4 жыл бұрын
Bro I want to know the code for finding 2nd highest no. In a given integer..example 56879 in this value we have to find the 2nd highest no.
@mayuringale6898
@mayuringale6898 4 жыл бұрын
@@ezhilv4358 #include #include int main() { int n,num; int large1=0,large2=0; clrscr(); printf("Enter no. of numbers: "); scanf("%d",&n); printf("Enter %d numbers, one by one: ",n); while(n>=1) { scanf("%d",&num); if(num > large1) { large1=num; } if(num > large2 && num < large1) { large2=num; } n--; } printf(" The largest number entered is %d",large1); printf(" and the second largest one is %d",large2); getch(); return 0; }
@filmoviNaTi
@filmoviNaTi 5 жыл бұрын
I think there's an error. If you enter b = 0, it'll print garbage value as the output. You didn't consider that possibility?
@ProgrammingwithArijit
@ProgrammingwithArijit 4 жыл бұрын
yes inspite of printing value of sum if we print value of a then this posibilty of garbage value will be solved
@mdf1259
@mdf1259 4 жыл бұрын
@@ProgrammingwithArijit Super
@venkythesmart440
@venkythesmart440 4 жыл бұрын
Sir make one video please minus numbers. how to write binary. This program you write only positive binary number. Thank you sir
@ShivaniSingh-jt6kl
@ShivaniSingh-jt6kl 4 жыл бұрын
Thank you so such detailed explanation
@niveshduppalapudi6616
@niveshduppalapudi6616 5 жыл бұрын
i lub ur videos...clear explanation
@lawrencemuthui
@lawrencemuthui Жыл бұрын
After the loop, assign sum = a; before printf just incase b = 0;
@pravatkumarbehera2928
@pravatkumarbehera2928 6 жыл бұрын
thanks sir
@umairalvi7382
@umairalvi7382 5 жыл бұрын
The left shift and right shift operators should not be used for negative numbersIf any of the operands is a negative number, it results in undefined . Sir can you please clear this point when you entered the negative numbers how it is giving the correct answer.
@suryak-bs7ez
@suryak-bs7ez 3 жыл бұрын
See 2,s complement representation of numbers. Subtracting a number is same as adding 2's complement of the number. Therefore, it works for negative numbers also.
@shaurya5harma
@shaurya5harma 5 ай бұрын
a-(-b) krlo guru bina + ke kara doonga. Thanks garry shashank for this wonderful explaination
@mislead1070
@mislead1070 2 жыл бұрын
4:20 I guess those equations wont give proper ans everytime Bec, When you do 5+10 in binary, the ans is 15 in which sum is 15 while carry is 0 But, When you do 7+2 in binary, the ans is 9, but the sum you get using Xor is 5 while the Carry you get using Bitwise And is 2, and lets say even if you add that 5 with 2 also, still you get the Sum using Xor as 7 and Carry using Bitwise And as 0, and now you aren't left with any further carries found using Bitwise And in order to add it up with the Sum we found using Xor i.e. 7!!!
@karthickrock1060
@karthickrock1060 5 жыл бұрын
why you are not using a-(-b), this is the very simple logic
@vijayclasher6876
@vijayclasher6876 4 жыл бұрын
That's y they are not using bro;)
@RAHULKUMAR-cw3gq
@RAHULKUMAR-cw3gq 4 жыл бұрын
@@vijayclasher6876 🤣
@engmoatazabdelhalim7343
@engmoatazabdelhalim7343 6 күн бұрын
Too simple to be thought about 😂
@baidya87
@baidya87 4 жыл бұрын
Super explanation.
@ezhilv4358
@ezhilv4358 4 жыл бұрын
Bro I want to know the code for finding 2nd highest no. In a given integer..example 56879 in this value we have to find the 2nd highest no.
@Strategic.
@Strategic. 3 жыл бұрын
/*This is my version of the program */ //Adding two integers without the + sign : #include int main() { printf("Give a and b "); int a, b,i; scanf("%d %d",&a,&b); if (b>=0) { for (i=0; i
@sarkarflutist8655
@sarkarflutist8655 3 жыл бұрын
Awesome explaination..👏👏👏
@Abhishek-yf7wi
@Abhishek-yf7wi 2 жыл бұрын
int main() { int n,a; printf("Enter two number "); scanf("%d%d",&n,&a); int sum=n; for(int i=1;i=0) sum++; else sum--; } printf("The sum of %d and %d is : %d",n,a,sum); return 0; } This does the same.
@Brett13081992
@Brett13081992 6 жыл бұрын
Sir also add some topics on Power System Analysis and Control System
@mounikapavani6904
@mounikapavani6904 6 жыл бұрын
Sir please explain logic for multiplication operations with using *operator
@konthamhema4658
@konthamhema4658 4 жыл бұрын
Idea is Take a number like 2*3.so what we have to do is add a=2 ,b=3 times 2+2+2 the answer will be six That means we have to add the same number to itself upto b=3 times
@vasubhatt6160
@vasubhatt6160 4 жыл бұрын
You should have explained the logic of the program by using -ve values too.
@akshatbhutra7278
@akshatbhutra7278 5 жыл бұрын
nice
@vrishabshetty1325
@vrishabshetty1325 5 жыл бұрын
Sir we can write one while loop for addition of two no. In that while we can we if .else
@NikhilKumar-ev2ml
@NikhilKumar-ev2ml 3 жыл бұрын
previous program can add negative integers also
@yogeshlather8460
@yogeshlather8460 3 жыл бұрын
given numbers in decimal format,then why we do not convert these numbers in binary format
@ezhilv4358
@ezhilv4358 4 жыл бұрын
Bro I want to know the code for finding 2nd highest no. In a given integer..example 56879 in this value we have to find the 2nd highest no.
@shishankrawat2105
@shishankrawat2105 3 жыл бұрын
convert the int to string and then loop it all to get whatever value you want. I can also give you the code if u ask.
@esma2856
@esma2856 2 жыл бұрын
@@shishankrawat2105 can you send the code?
@woundman6521
@woundman6521 3 жыл бұрын
What to do if i am unable to understand
@sergey1519
@sergey1519 6 жыл бұрын
What about a = b - (0-c)?
@mrmakra-eo1kx
@mrmakra-eo1kx 5 жыл бұрын
You can use this one instead a = b - (-c) Without the 0
@harshavardhankanoj6021
@harshavardhankanoj6021 3 жыл бұрын
If we enter b=0 in half adder program, it prints garbage values
@yenzyhebron5278
@yenzyhebron5278 3 жыл бұрын
Nope it doesn't, I tried
@yoddha621
@yoddha621 4 жыл бұрын
AWESOME
@ProgrammingwithArijit
@ProgrammingwithArijit 4 жыл бұрын
if you give b=0 then the program will give you garbage value . Solution-----inspite of printing value of sum if we print value of a then this posibilty of garbage value will be solved as a=sum and also if b=0 then sum=a. Explanation----if we give b=0 then the controll will not enter in while loop as 0!=0 is false. so if we print value of sum it will give you garbage as sum is not initialized .
@sulagnasaha28
@sulagnasaha28 4 жыл бұрын
You can also use 'do-while' loop... for y=0, do-while loop will execute at least once and you can write the printf statement as printf("The sum is :%d",sum); Hope it will help...
@himadribiswas1105
@himadribiswas1105 2 жыл бұрын
Sir, I am currently learning C programming from your lectures. May I ask you about a problem in the half adder code? The code works totally fine in all situations accept one case: when b is 0(it produces result 0 whatever a is). I think the bug can be fixed by using the variable "a" in printf(And not "sum"). Thank you, sir. I hope it might help.
@anjaliverma905
@anjaliverma905 4 жыл бұрын
How to add -5 and -6 ??
@abdelatif4002
@abdelatif4002 3 жыл бұрын
while(m!=0){ if(m>0){ n++; m--; } if(m
@Strategic.
@Strategic. 3 жыл бұрын
//Adding two integers without the + sign : #include int main() { printf("Give a and b "); int a, b,i; scanf("%d %d",&a,&b); if (b>=0) { for (i=0; i
@SS-zj1yg
@SS-zj1yg 4 жыл бұрын
What's the use of this concept in real world?
@rishisharma5249
@rishisharma5249 6 жыл бұрын
Who the fuck disliking these exiting educational videos 😡😡😡
@Victor_Marius
@Victor_Marius 5 жыл бұрын
x -= -y; 😂 without + operator
@Name-is2bp
@Name-is2bp 3 жыл бұрын
wow, I actually got carried away with the course and forgot that it can be this simple.
3 жыл бұрын
without using + uses 2 + lmaooo
@SurjeetVerma-c8t
@SurjeetVerma-c8t Жыл бұрын
I did like this 👇 #include int main() { //adding two values without using "+"" operator int x, y; printf("Enter any two numbers: "); scanf("%d %d",&x, &y); for (int i=0; x!=0; i++) { if(x
@true4189
@true4189 4 жыл бұрын
Thank u
Special Programs in C − Fibonacci Series
7:10
Neso Academy
Рет қаралды 233 М.
Special Programs in C − Pyramid of Stars
11:06
Neso Academy
Рет қаралды 893 М.
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 29 МЛН
From Small To Giant 0%🍫 VS 100%🍫 #katebrush #shorts #gummy
00:19
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 8 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 8 МЛН
Add Two Numbers Without The "+" Sign (Bit Shifting Basics)
18:25
Back To Back SWE
Рет қаралды 125 М.
Logical Operators in C
12:09
Neso Academy
Рет қаралды 441 М.
Special Programs in C− Check If The Number Is Armstrong Number
12:16
Recursion in C
11:12
Neso Academy
Рет қаралды 954 М.
The KEY To Thinking Like a Programmer (Fix This Or Keep Struggling)
10:39
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 29 МЛН