write a program to swap Two numbers without using temp variable.
Answer Posted / 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 View All Answers
How can I open a file so that other programs can update it at the same time?
Write a program for Overriding.
Which programming language is best for getting job 2020?
Why do we use header files in c?
Explain two-dimensional array.
Compare and contrast compilers from interpreters.
what are the advantages of a macro over a function?
How can I do serial ("comm") port I/O?
What is the use of #define preprocessor in c?
Why do we need functions in c?
What are the two types of functions in c?
How can I call a function with an argument list built up at run time?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is the difference between class and object in c?
What is scope rule of function in c?