C language program to swap the values of two variable without using third variable



C language program to swap the values of two variable without using third variable

C language program to swap the values of two variable without using third variable

C Language Code or Program to swap or interchange values of two integer type variables without using the third variable

In this simple program 2 integer type variables declared with names a and b . After that two messages are displayed using prinf() function to enter the values of a and b.
scanf() function is used read the value of a and b variables from the keyboard. After that following assignment logic is used to interchange the values of a and b by using t.

a=a+b; // add a and b and store the result in a
b=a-b; // subtract b from a then store it in variable b
a=a-b; // subtract b from a again then store it in variable a

and after that final values of a and b are displayed using printf() function.

So Subscribe the channel for more interesting coding videos.

Microsoft Visual Studio Code Version 1.80.1 IDE is used to Edit, Compile and Run the Code

#code #coding #computerprogramming #clanguage #clanguagecode
#cprogramming #codingforbeginners #visualstudiocode #program #cprogrammingquestions #learnclanguage #learncoding