Page

source code for swapping two values with out third variable in c language

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

No comments:

Post a Comment