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

#include<stdio.h>
void main()
{
int a=2,b=3;
printf("before swap the value is:::");
printf("a=%d\tb=%d",a,b);
b=a+b-(a=b);
printf("after swap the value is:::");
printf("a=%d\tb=%d",a,b);
}

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are multibyte characters?

1183


Why do we need a structure?

1037


Where are some collections of useful code fragments and examples?

1156


Where is volatile variable stored?

1084


Explain what are compound statements?

1056


Explain about block scope in c?

1089


What do you mean by keywords in c?

1143


What are the advantages and disadvantages of a heap?

1205


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

1294


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1120


Define the scope of static variables.

1127


What is void c?

1077


How do you sort filenames in a directory?

1166


Is c++ based on c?

1070


What is the difference between constant pointer and constant variable?

1220