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.

Answers were Sorted based on User's Feedback



write a program to swap Two numbers without using temp variable...

Answer / jaspreet singh

no sree although it swap the xalues but when we give the
input as a=32767 n b=1 it will give the wrong answer

Is This Answer Correct ?    17 Yes 22 No

write a program to swap Two numbers without using temp variable...

Answer / tamerat

q

Is This Answer Correct ?    8 Yes 13 No

write a program to swap Two numbers without using temp variable...

Answer / nagarjun

main()
{
int a=4,b=5;
/*b=(a+b)-(a=b);*/
a^=b^=a^=b;
printf(" \n %d %d \n",a,b);
}

Is This Answer Correct ?    21 Yes 28 No

write a program to swap Two numbers without using temp variable...

Answer / naresh

main()
{
int a,b,c;
printf("enter a,b value");
scanf("%d%%d",&a,&b);
c=a^=b^=a^=b;
printf("%d",c);
}

Is This Answer Correct ?    67 Yes 150 No

write a program to swap Two numbers without using temp variable...

Answer / yash paranjape

int main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=c^=a;//swap a and b
printf("%d%d",a,b);//numbers r swapped
}

Is This Answer Correct ?    82 Yes 189 No

Post New Answer

More C Interview Questions

in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

0 Answers  


Do you have any idea how to compare array with pointer in c?

0 Answers  


In a header file whether functions are declared or defined?

0 Answers   TISL,


What is the most efficient way to count the number of bits which are set in a value?

4 Answers  


main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }

4 Answers   CTS,


What is Generic pointer? What is the purpose of Generic pointer? Where it is used?

3 Answers  


Can you think of a way when a program crashed before reaching main? If yes how?

2 Answers  


What is a structure and why it is used?

0 Answers   Hexaware,


Why we use void main in c?

0 Answers  


1.)how to find d most repeated word in a string? string ="how do you do"?? output should be do

1 Answers   AAS, Nagarro, Vuram,


write a c program to add two integer numbers without using arithmetic operator +

13 Answers   Value Labs,


What is c standard library?

0 Answers  


Categories