C Program to swap two numbers without using third variable|E-studyblog2021|
In this C-Program,we swap two numbers without using the third variable.We have done this Program by using (+) and (-).
- C Program to swap two number with using third variable
- C Program to find the factorial of the number
- C Program to check whether the number is Palindrome or not
C Program to swap two numbers without using third variable|E-studyblog2021| |
C Program to swap two numbers without using third variable|
// C program to swap the two numbers without using third variable #include <stdio.h> int main(){ int a,b; printf("\nEnter the value of x & y\n"); scanf("%d %d",&a,&b); printf("Before Swapping numbers :%d %d\n",a,b); a=a+b; b=a-b; a=a-b; printf("\nAfter Swapping: %d %d\n",a,b); return 0; }
I hope you have read our Article "C Program to Swap the two numbers without using third variable|E-studyblog" and you have collected lots of information from there.If you like the post,then please comment and share among your friends and family. you can write your opinion about my post in the comment box.
Thank you!
No comments:
Post a Comment
If you have any queries ,please let us know