write a program to swap Two numbers without using temp variable.
Answer Posted / ankit
a=a+b;
b=a-b;
a=a-b;
example int a=2;int b=3
put a=2 & b=3
a=2+3;
b=5-3;
a=5-2;
a=3;
b=2;
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What does the file stdio.h contain?
How we can insert comments in a c program?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Explain the bubble sort algorithm.
Are there any problems with performing mathematical operations on different variable types?
What is the difference between array and pointer in c?
Explain what are run-time errors?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What does node * mean?
What is extern c used for?
What is the use of printf() and scanf() functions?
Why isnt there a numbered, multi-level break statement to break out
What is the use of header?
Explain what are the __date__ and __time__ preprocessor commands?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }