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

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

int a=10,b=8;
a=a+b;//a=10+8=18
b=a-b;//b=18-8=10
a=a-b;//a=18-10=8
//hence a=8,b=10
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between scanf and gets?

1217


Are global variables static in c?

1129


How can a number be converted to a string?

1277


What is chain pointer in c?

1031


Why is sizeof () an operator and not a function?

999


Differentiate abs() function from fabs() function.

979


What is 1d array in c?

1051


Do array subscripts always start with zero?

1257


How can I write a function that takes a format string and a variable number of arguments?

1015


Why is main function so important?

1069


What is the heap in c?

1051


What is strcmp in c?

1065


What is the difference between exit() and _exit() function?

1015


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2322


Differentiate between #include<...> and #include '...'

1029