swap two numbers without using a temporary variable …

124
462

C Program to swap two numbers without using third variable with programming examples for beginners and professionals covering concepts, control statements, c array, c pointers, c structures, union, c strings and more.

swap.c

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("\n enter the value of a and b :");
scanf("%d %d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("swapping of a=%d",a);
printf("swapping of b=%d",b);
getch();
}

 

124 COMMENTS

  1. Your writing is perfect and complete. totosite However, I think it will be more wonderful if your post includes additional topics that I am thinking of. I have a lot of posts on my site similar to your topic. Would you like to visit once?

  2. When I read an article on this topic, totosite the first thought was profound and difficult, and I wondered if others could understand.. My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?

  3. I have been looking for articles on these topics for a long time. casinocommunity I don’t know how grateful you are for posting on this topic. Thank you for the numerous articles on this site, I will subscribe to those links in my bookmarks and visit them often. Have a nice day

  4. buy stromectol online uk So if you are in the middle of the SARMs cycle, and you start to feel blue, low, and lacking in energy, and it goes on for a few days, then it could be a sign that your testosterone levels are dropping because your body is starting to produce less

LEAVE A REPLY

Please enter your comment!
Please enter your name here