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

Answer Posted / vigneswari

#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d;
cout<<"\n enter a:";
cin>>a;
cout<<"\n enter b:";
cin>>b;
c=a+b;
d=a-b;
c=a-b;
cout<<"\n answer a :"<<c;
cout<<"\n answer b:"<<d;
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can we change the default calling convention in c if yes than how.........?

2030


Describe wild pointers in c?

636


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

655


List the difference between a While & Do While loops?

629


What functions are used in dynamic memory allocation in c?

591






What is the role of && operator in a program code?

564


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

589


Is register a keyword in c?

629


Can a local variable be volatile in c?

573


Write a program to know whether the input number is an armstrong number.

663


What is the time and space complexities of merge sort and when is it preferred over quick sort?

672


write a program for the normal snake games find in most of the mobiles.

1783


using for loop sum 2 number of any 4 digit number in c language

1729


What is %g in c?

612


What is the use of static variable in c?

593