C Programming Exercise | Program to Swap 2 Numbers Using a temp / third Variable

preview_player
Показать описание
In this c,cpp programming language video tutorial for beginners, you will learn how to write a program to swap two numbers by using a temp/third variable in detail with example.

watch more free video tutorials at

Catch us on SocialMedia
Комментарии
Автор

I had a lot of trouble visualizing this logic. Thank you very much for making it clear, sir!

amalia
Автор

Thank you for that great explanation with examples which make me easier to understand.

what-tkcc
Автор

Take 5 elements and do sort 10, 30, 20, 50, 40

RamyaBeenamoni
Автор

Thank you so much, this is such an understandable and simple explanation. Now i understand :) xoxo

AyuJessieM
Автор

Sir y u don't reply to these tutorials u only replied to first tutorials nd now y u r not using conio.h

harshavardhanupputuri
Автор

In C++
template<typename T> inline void swap(T* x, T* y) { T z=*x; *x = *y; *y = z; }
or
template<typename T> inline void swap(T& x, T& y) { T z=x; x = y; y = z; }
It's also in the STL. I'm that 'tis annoyingly obvious.

aidandanielski
join shbcf.ru