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
What are the types of arrays in c?
Is there any demerits of using pointer?
What is a lookup table in c?
Explain pointer. What are function pointers in C?
What is main function in c?
Explain what math functions are available for integers? For floating point?
How can you check to see whether a symbol is defined?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
How main function is called in c?
what is a constant pointer in C
What is file in c preprocessor?
Differentiate between calloc and malloc.
How can I run c program?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
What is the meaning of 2d in c?