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
can we change the default calling convention in c if yes than how.........?
Describe wild pointers in c?
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.
List the difference between a While & Do While loops?
What functions are used in dynamic memory allocation in c?
What is the role of && operator in a program code?
What are the functions to open and close the file in c language?
Is register a keyword in c?
Can a local variable be volatile in c?
Write a program to know whether the input number is an armstrong number.
What is the time and space complexities of merge sort and when is it preferred over quick sort?
write a program for the normal snake games find in most of the mobiles.
using for loop sum 2 number of any 4 digit number in c language
What is %g in c?
What is the use of static variable in c?