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 / jisha. k.a

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

Is This Answer Correct ?    34 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is default value of global variable in c?

954


What is typedef example?

1133


explain what are actual arguments?

1050


Which are low level languages?

1059


what is bit rate & baud rate? plz give wave forms

1926


What is null pointer constant?

1090


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

1187


Which header file is essential for using strcmp function?

1435


What are void pointers in c?

976


What is the difference between %d and %i?

1062


Should I learn data structures in c or python?

994


How can I implement a delay, or time a users response, with sub-second resolution?

1049


What is wrong with this declaration?

1065


How #define works?

1062


Create a simple code fragment that will swap the values of two variables num1 and num2.

1243