How To Write a C Program To Swap Of Two No’s Without Using Third Variable in C Programming Language ?
Solution For C Program To Swap Of Two No’s Without Using Third Variable:
#include<stdio.h> #include<conio.h> void main() { int a,b; clrscr(); printf("Enter value for num1 & num2 : "); scanf("%d %d",&a,&b); a=a+b; b=a-b; a=a-b; printf("After swapping value of a : %d",a); printf("After swapping value of b : %d",b); getch(); }Output :Enter value for num1 & num2 : 10 20 After swapping value of a : 20 After swapping value of b : 10
Tags: C Program To Swap Of Two No’s Without Using Third Variable, c program to swap two numbers without using third variable, c program to swap two numbers without using third variable using functions, program to swap two numbers without using third variable in c language, write a program to swap two numbers without using third variable in c#, program to swap two numbers without using third variable in php, program to swap two numbers without using third variable in java, c program to swap two numbers without using temporary variable, c program to swap two numbers using pointers.