write a program to swap Two numbers without using temp variable.
Answer Posted / ravi saini
void main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=a^=b;
printf("%d%d",a,b);//swapped no
}
Is This Answer Correct ? | 119 Yes | 66 No |
Post New Answer View All Answers
Is there a way to compare two structure variables?
What’s a signal? Explain what do I use signals for?
What is spaghetti programming?
Give differences between - new and malloc() , delete and free() ?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is wrong with this initialization?
Where is c used?
List the difference between a "copy constructor" and a "assignment operator"?
The statement, int(*x[]) () what does in indicate?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
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
What are pointers?
List a few unconditional control statement in c.