Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to interchange two variables without using
the third variable?

Answer Posted / mahendra giri

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
c=a+b;
b=a-b;
a=a-b;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    23 Yes 44 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are loops in c?

971


How many data structures are there in c?

1076


How can I insert or delete a line (or record) in the middle of a file?

994


Why string is used in c?

967


What are the differences between new and malloc in C?

1093


Is c++ based on c?

1044


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1186


What is the usage of the pointer in c?

1066


What is the use of linkage in c language?

1029


what is the structure pointer?

2087


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

1086


What is abstract data structure in c?

998


What are linked lists in c?

1104


How can I read/write structures from/to data files?

937


Why do we use c for the speed of light?

1129