A program swap without using third variable
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include<stdio.h> int main() { int a,b; a=4; b=6; printf("a=%d\nb=%d\n",a,b); printf("---------------\n"); a=a+b; b=a-b; a=a-b; printf("a=%d\nb=%d",a,b); } |
A blog about programming languages and this Blog specially Create for learning languages like C language,C++ Language, Data Structure and Algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include<stdio.h> int main() { int a,b; a=4; b=6; printf("a=%d\nb=%d\n",a,b); printf("---------------\n"); a=a+b; b=a-b; a=a-b; printf("a=%d\nb=%d",a,b); } |
Post a Comment