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

What are local static variables? How can you use them?

1154


What is the difference between array and pointer in c?

1167


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2266


What do you mean by invalid pointer arithmetic?

1087


What is the purpose of ftell?

1089


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

1034


What are structural members?

1018


How can you call a function, given its name as a string?

1162


Where register variables are stored in c?

970


What is a pointer in c?

1584


Explain logical errors? Compare with syntax errors.

1078


How do you use a pointer to a function?

1093


Explain that why C is procedural?

1149


What is the role of this pointer?

1077


Difference between macros and inline functions? Can a function be forced as inline?

1281