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 / ajith c.k

#include"stdio.h"
int swap(int *,int*);
int main()
{
int a,b;
printf("enter two number");
scanf("%d%d",&a,&b);
swap(&a,&b);
printf("%d\t%d",a,b);
return ;
}
int swap(int *s,int *q)
{

if(*s==*q)
return;
*s^=*q;
*q^=*s;
*s^=*q;
return ;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the error message "DGROUP exceeds 64K" mean?

1168


Whats s or c mean?

950


p*=(++q)++*--p when p=q=1 while(q<=6)

1697


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3474


What is calloc() function?

1047


What is a macro in c preprocessor?

1051


In C language, a variable name cannot contain?

1222


Combinations of fibanocci prime series

1555


What is && in c programming?

1111


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1048


Where register variables are stored in c?

909


When is a void pointer used?

1192


Where we use clrscr in c?

1090


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

996


What are reserved words with a programming language?

1055