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...

How do we swap or interchange any 2 numbers without using
Temporary variable...Anybody can pls answer it.. Thanks in
Advance

Answer Posted / girish

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int a,b;
clrscr();
printf("Enter the two values:");
scanf("%d%d",&a,&b);
swap(a,b);
pritnf("the swaping of given two values are:\na=%d,b=%
d",a,b);
getch();
}

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between memcpy and memmove?

1035


Is a house a shell structure?

1165


What are the functions to open and close the file in c language?

1041


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

1278


What is a good way to implement complex numbers in c?

1053


What does *p++ do? What does it point to?

1065


What is indirection?

1097


How are portions of a program disabled in demo versions?

1298


Write the syntax and purpose of a switch statement in C.

1109


If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.

2278


What is difference between structure and union with example?

1059


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

1162


What is a memory leak? How to avoid it?

1350


What is C language ?

1969


When should we use pointers in a c program?

1142