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 / tchoephel

#include<stdio.h>
#include<conio.h>
void main()
{

int a,b;
printf("enter two nos A and B\n");
scanf("%d%d",a,b);
printf("before swaping A=%d\n B=%d\n",a,b);
a=a+b:
b=a-b;
a=a-b;
prinf("after swaping A=%d\n B=%d\n",a,b);
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better pointer or array?

974


What are the primitive data types in c?

1006


difference between native and cross compilers

2080


What is a pointer on a pointer in c programming language?

1091


Is javascript based on c?

998


Explain what is a static function?

1047


What is the difference between a free-standing and a hosted environment?

1097


How is actual parameter different from the formal parameter?

973


How can I pad a string to a known length?

969


what will be maximum number of comparisons when number of elements are given?

1849


What do you understand by friend-functions? How are they used?

1157


Explain what is the difference between far and near ?

1048


how to write optimum code to divide a 50 digit number with a 25 digit number??

3204


What is main function in c?

1015


What is the code for 3 questions and answer check in VisualBasic.Net?

2101