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 / sneha chorghade

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

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who developed c language and when?

1071


Why pointers are used in c?

1018


Write a factorial program using C.

1087


Can static variables be declared in a header file?

1065


Explain what is a static function?

1115


Write a program to print fibonacci series using recursion?

1068


What is void main ()?

1082


How arrays can be passed to a user defined function

1028


Explain two-dimensional array.

1085


Explain the advantages of using macro in c language?

1006


Which header file is used for clrscr?

1063


What is the purpose of clrscr () printf () and getch ()?

1073


What is a ternary operator in c?

1127


How can I find out the size of a file, prior to reading it in?

1181


What is file in c language?

1010