write a program to swap Two numbers without using temp variable.
Answer Posted / amar
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 ? | 1 Yes | 0 No |
Post New Answer View All Answers
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
What is a protocol in c?
What is #pragma statements?
Explain what is the stack?
shorting algorithmS
What is a program?
How can I avoid the abort, retry, fail messages?
Can you think of a logic behind the game minesweeper.
What is the difference between malloc() and calloc() function in c language?
What is return in c programming?
What type of function is main ()?
Why isn't it being handled properly?
Can a pointer be null?
What is boolean in c?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?