The Tech World..!!
C Program for swapping of 2 Numbers without using third Variable
#include<stdio.h>
int main()
{
int a, b ;
printf("Enter 2 Numbers \n");
scanf("%d \t %d",&a,&b);
a = a + b ;
b = a - b ;
a = a - b ;
printf("The swapped Numbers are ");
printf("a = %d \t b= %d \n",a,b);
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment