EmbLogic's Blog

swaping of two value without using third variable

#include<stdio.h>
int main()
{
int a,b;
printf(“Enter the value of a:”);
scanf(“%d”,&a);
printf(“Enter the value of b:”);
scanf(“%d”,&b);
a=a+b;
b=a-b;
a=a-b;
printf(“%d”,a);
printf(“%d”,b);
return 0;

}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>