write a program to swap Two numbers without using temp variable.
Answer Posted / diponkor roy
#include<iostream>
using namespace std;
int main()
{
int x,y;
cin>>x;
cin>>y;
cout<<"You enter"<<x <<" and"<<y<<endl;
x=x*y;
y=x/y;
x=x/y;
cout<<"After swap your number "<<x <<" and"<<y<<endl;
return 0;
}
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What are the applications of c language?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Explain what are global variables and explain how do you declare them?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
Do pointers store the address of value or the actual value of a variable?
Give basis knowledge of web designing ...
What is the difference between null pointer and wild pointer?
How are pointers declared in c?
why we wont use '&' sing in aceesing the string using scanf
What is a pointer in c plus plus?
In a header file whether functions are declared or defined?
What is use of pointer?
What is function definition in c?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
write a program fibonacci series and palindrome program in c