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 swap Two numbers without using temp variable.

Answer Posted / saurav raj

#include<stdio.h>
#include<conio.h>

void main()
int a,b;
clrscr();
printf("Enter Two number a & b:- ");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("\nA=%d \t B=%d",a,b);
getch();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is typedef?

1322


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5888


What is a union?

976


Explain what does it mean when a pointer is used in an if statement?

1000


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1933


int far *near * p; means

3502


what will be the output for the following main() { printf("hi" "hello"); }

10779


What the different types of arrays in c?

1019


Write a program to check palindrome number in c programming?

957


Differentiate between a for loop and a while loop? What are it uses?

1128


Can you define which header file to include at compile time?

979


What is the purpose of ftell?

1030


How do we print only part of a string in c?

969


Explain how can I write functions that take a variable number of arguments?

1026


What is difference between %d and %i in c?

1178